Hi everyone,
I have a PHP generated Jumpmenu on my site, using tablenames as group-headers.
I want my table about_me to show as about me.
I've been told to use str_replace() but have no clue how?
Can anyone help me? Here's my code
(btw not all tables have a underscore.... is that a problem?)
<?PHP
$link = mysql_connect();
$db=content;
if (! $link)
die( "couldn't connect");
mysql_select_db($db)
or die ("won't open test:".mysql_error() );
$db_res=mysql_list_tables("$db",$link);
$num=mysql_num_rows($db_res);
for($x=0; $x<$num; $x++)
{
$table=mysql_tablename($db_res,$x);
/////////Don't want underscore here////////////////
print "<option>".$table."</option><br>
////////That way my link shows the space/////////
{
$query = "SELECT DISTINCT * FROM $table";
$result = mysql_query($query) or die("Error in query");
while($row = mysql_fetch_assoc($result))
{
print "<option value=".$row['Field2']."> -".$row['Field1']."</option><br>\n";
}
}
}
?>
Jacco