|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Sorry to pawn this off on you all, but I've gone back and forth on this darned thing and can't figure this out.
I keep getting a parse error, which I assume means I have a problem in the PHP. The MySQL query works if I put it in directly in Telnet, but it gives me a parse error otherwise. HELP! ANY help would be GREATLY appreciated! <HTML><HEAD> <TITLE>Untitled</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF"> <?php $server = "localhost"; $user = "*****"; $pass = "*****"; $db = "chaco"; $connection = mysql_connect($server, $user, $pass); $query = "SELECT * FROM trovemain WHERE (cata LIKE 'a%')"; $result = mysql_db_query($db,$query,$connection); $row = mysql_fetch_array($result); printf("Name: ",echo $row["name"]); printf("<br>"); echo $row["origin"]; printf("<br>"); echo $row["link"]; ?> </BODY> </HTML> |
|
#2
|
|||
|
|||
|
>>> $query = "SELECT * FROM trovemain WHERE (cata LIKE 'a%')";
Why the ()? This works:' $query = "SELECT * FROM trovemain WHERE cata LIKE 'a%'"; |
|
#3
|
|||
|
|||
|
Your error is in this line:
printf("Name: ",echo $row["name"]); Also, why are you using printf? You aren't issueing in formatting parameters. |
|
#4
|
|||
|
|||
|
Is stupidity a good reason?
|
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > why won't this PHP/MySQL search work?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|