Re: Why parse error in mysql command?
| From: | Andy Ziem | Date: | Sat, 02 Feb 2002 17:39:17 +0000 |
| Subject: | Re: Why parse error in mysql command? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-11797@lists.php.net to get a copy of this message | ||
The error is on the line
"$result = mysql_query("SELECT * FROM names WHERE id=$id");"
I have checked many things and can't figure out the error. MySQL is running.
The database exists. The table names is valid. $id is defined as 1.
Thanks,
Andy
Quoting Mike Flynn <mike@mikeflynn.net>:
> If the error is on line 10, please show us the entire code so we can see
>
> line 10. :)
>
> At 09:26 AM 2/2/2002 -0800, you wrote:
> >Hi,
> >
> >I am trying to retreive stored data, and I can't figure out why I
> receive
> >this PHP error--even after reading PHP documentation and looking at
> >examples--
> >
> > "Parse error: parse error in c:\vol\php\e.php on line 10"
> >
> >The following is my simplified code:
> >
> ><?php
> >
> > mysql_connect("localhost", "root");
> >
> > mysql_select_db("volunteers");
> >
> > $result = mysql_query("SELECT * FROM names WHERE id=$id");
> >
> > &line = mysql_fetch_row(&result);
> >
> > $first = $line["first"];
> > $middle = $line["middle"];
> > $last = $line["last"];
> >
> > $street = $line["street"];
> > $city = $line["city"];
> > $zip = $line["zip"];
> >
> >?>
> >
> >
> >
> >--
> >Andy Ziem
> >Is Jesus Your Answer?
> >http://www.ChristianAnswers.net/gospel
> >
> >
> >
> >
> >
> >----------------------------------------------------
> >Get a FREE E-Mail account at http://www.ACMEmail.net
> >
> >--
> >PHP Windows Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> >For additional commands, e-mail: php-windows-help@lists.php.net
> >To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
> -=- Mike Flynn - Burlington, VT -=-
> mike@mikeflynn.net http://www.mikeflynn.net/ * Give blood *
> ...maintaining lawns, watching televised sports, birthing
> children, listening to Top 40 music, and collecting
> stuffed animals...
>
>
>
Andy Ziem
http://www.springsrescuemission.org
----------------------------------------------------
Get a FREE E-Mail account at http://www.ACMEmail.net