Re: Variable Appended To The End of a URL Is Not Working in SQL Query
| From: | Dr. Shim | Date: | Tue, 02 Apr 2002 17:13:10 +0000 |
| Subject: | Re: Variable Appended To The End of a URL Is Not Working in SQL Query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-91176@lists.php.net to get a copy of this message | ||
I'm using ODBC (Access). But I can execute the SQL manually in Access too. I
did, here's my query:
SELECT * FROM fldField WHERE IDField = 3;
I have to actually put in a value for "IDField", it doesn't recognize my
variable, of coarse. This works just fine.
"Rick Emery" <remery@excel.com> wrote in message
news:EAA093B474ABD311A71E00508B5FE08305C2D40F@adntex03.us.excel.com...
Jason means that you should execute it from the mysql command line;
In your PHP code: print $sql.
Then copy from that window and paste into mysql command line and execute.
What are the results?
-----Original Message-----
From: Dr. Shim [mailto:ultimatezzz@hotmail.com]
Sent: Monday, April 01, 2002 10:48 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Variable Appended To The End of a URL Is Not Working
in SQL Query
Hmm, run it manually? I'm a newbie, so, could you explain how I'd do that?
=)
"Jason Murray" <Jason.Murray@melbourneit.com.au> wrote in message
news:1595534C9032D411AECE00508BC766FB03C1CC5A@mercury.mit...
I'd say $id is blank, not being passed in, or is equal to a
nonexistant IDArt.
Maybe you should echo out your SQL and run it manually to see
what's going on.
J
--
Jason Murray
jasonm@melbourneit.com.au
Web Developer, Melbourne IT
"Work now, freak later!"
> -----Original Message-----
> From: Dr. Shim [mailto:ultimatezzz@hotmail.com]
> Sent: Tuesday, April 02, 2002 2:41 PM
> To: php-general@lists.php.net
> Subject: [PHP] Variable Appended To The End of a URL Is Not Working in
> SQL Query
>
>
> I have a variable which is appeneded to the end of a URL, like
>
>
> http://www.your_web_site.com/your_page/?your_variable=your_value
>
> This would return "your_value";
>
> echo $your_variable;
>
> But this wouldn't work, and returns an error
>
> $sql = "SELECT * FROM fldField WHERE IDField = " . $id;
>
>
> What could possibly be wrong? If you need more info, then
> tell me. Here's my
> code:
>
> <?php
> $db = @odbc_connect('ReviewDatabase', 'root', '') or
> exit)("Error
> occured:<br>$php_errormsg");
> $sql = "SELECT * FROM tblArt WHERE IDArt = $id";
> $cursor = @odbc_exec($db, $sql) or exit ("Error
> occrued:<br>$php_errormsg");
> odbc_close($db);
> ?>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php