Quick question. please help
Posted: Thu Jul 31, 2008 9:13 pm
I am dieing trying to figure this out for days! Searching is not helping. How do I use str_replace with an array. I have a list of results. I need the str_replace to go through each result as it is printed and change all the spaces with "+" symbols so they can be transfered through the url bar.
Here is what my code.
<?php
include("dbinfo.inc.php");
mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT model, COUNT(model) FROM table1 GROUP BY model";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "<a href=search.php?var2=". $row['$model'] .">". $row['model'] ."</a> (". $row['COUNT(model)'] .")";
echo "<br>";
}
?>
Please help!
Here is what my code.
<?php
include("dbinfo.inc.php");
mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT model, COUNT(model) FROM table1 GROUP BY model";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "<a href=search.php?var2=". $row['$model'] .">". $row['model'] ."</a> (". $row['COUNT(model)'] .")";
echo "<br>";
}
?>
Please help!