RE: [PHP] Help?
| From: | Wee Chua | Date: | Mon, 31 Jul 2000 17:29:20 +0000 |
| Subject: | RE: [PHP] Help? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-9207@lists.php.net to get a copy of this message | ||
Hi everyone,
Thanks for previous emails everyone, I have tried Julie's solution but I
still didn't work. I have tried
$result = mysql_query("Select * from $Game", $db)
$result = mysql_query("Select * from '$Game'", $db)
They all didn't work and gave me the same error. What is wrong with my code,
please help? Thanks.
Calvin
-----Original Message-----
From: Julie Meloni [mailto:julie@thickbook.com]
Sent: Monday, July 31, 2000 12:09 PM
To: Wee Chua
Cc: PHP (E-mail)
Subject: Re: [PHP] Help?
> <option value"Emp">Employee</option>
> <option value"Comp">Company</option>
You're going to want the "=" in there...
<option value="Emp">Employee</option>
<option value="Comp">Company</option>
So, now $Game will = either "Emp" or "Comp".
Assuming you've made a connection and selected a database, and $db is
the name of the link identifier you created with that selection, your
SQL statement of "select * from $Game" would be just fine, provided that
variable tracking is on and $Game becomes "Emp" or "Comp".
> $result = mysql_query("Select * from $Game",$db);
You can add a die() to this, to print a nice error:
$result = mysql_query("Select * from $Game",$db) or die(mysql_error());
- julie
+------------------------------------------------+
| Julie Meloni (jcm@i2ii.com) |
| Tech. Director, i2i Interactive (www.i2ii.com) |
| |
| "PHP Essentials" & "PHP Fast & Easy" |
| http://www.thickbook.com/ |
+------------------------------------------------+