PHP Code:
$sql="SELECT * FROM countries"; $result=mysql_query($sql); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $ccode = $row["ccode"]; echo '<h1>'.$row["country"].'</h1>'; sql2="SELECT * FROM `numbers` WHERE `location` = '".$ccode."'"; $result2=mysql_query($sql2); while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)) { echo '<table><tr>'; echo '<td><p>'.$row2["name"].'</p></td><td><a href="http://'.$row["url"].'">'.$row2["url"].'</a></td>'; echo '</tr></table>'; } }
getting an error for the line
PHP Code:
sql2="SELECT * FROM `numbers` WHERE `location` = '".$ccode."'";
any suggestions. the error says Parse error: parse error in C:\wamp\www\prototype1\index.php on line 42
I basically trying to make a script which will group url's depending on the country origin which is inputted by user.
Last edited by mintuz; 11-20-2010 at 06:10 PM..
|