|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have run the following SQL query through PHP but just get this error message: Parse error: parse error in /files/home3/**** /cgi-bin/rr.php on line 30 QUERY #!/usr/local/bin/php4 <? $db_name = "******_pn"; $table_name = "president"; $connection = @mysql_connect("*******", "*****r", "*******8") or die("Couldn't connect."); $db = @mysql_select_db($db_name, $connection) or die("Couldn't select database."); $sql = "SELECT last_name FROM $table_name "; $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); while ($row = mysql_fetch_array($result)) { $id = $row['last_name']; } $display_block .= " <P><strong>$id</strong> "; } ?> <HTML> <HEAD> <TITLE>My Music (Ordered by ID)</TITLE> </HEAD> <BODY> <H1>My Music</H1> <? echo "$display_block"; ?> </BODY> </HTML> Much thanks for any help. JD London |
|
#2
|
|||
|
|||
|
try...
...removing the closing brace i've indicated below:
PHP Code:
__________________
Little more than a playground for the bugs that live beneath us... |
|
#3
|
|||
|
|||
|
Thank you very much ghatzhat'
That did print an output, although I think I'm going to have to do some more reading up on the $id++ as no actual results were returned - I guess because I was not "looping" the result. Thank you once again JD |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Codeing problem with MySQL/PHP - Returning data. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|