Re: PHP/MySql Help
| From: | Burhan Khalid | Date: | Wed, 09 Apr 2003 21:30:29 +0000 |
| Subject: | Re: PHP/MySql Help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143213@lists.php.net to get a copy of this message | ||
On Wed, 2003-04-09 at 15:37, UGADawgs6910@aol.com wrote:
> Do you know why the following code wouldn't work?
>
> mysql_connect ("localhost", "crosse5_stringdo", "******") or die
> ('I cannot
> connect to the database because: ' . mysql_error());
> mysql_select_db ("crosse5_stringdoctororders");
>
>
> $insert = MYSQL_QUERY("SELECT ordernumber, name, emailaddy,
> dateupdate, timeupdate, stickstatus, received, predicted, express, mail,
> headnum, pocket, notes, payment FROM tracker where
> ordernumber='$OrderNumber'");
> ?>
>
Let me take a stab in the dark....
$OrderNumber is coming from a form.
You are getting "Resource is not a valid resultset" or some such
nonesense.
If that's the case...
Replace $OrderNumber with either $HTTP_GET_VARS["OrderNumber"] or
$_GET["OrderNumber"] depending on which version of PHP you have and what
the field id called in your form. Replace GET with POST in both cases if
you are POSTing.
For future reference, please post exact error as reported by PHP,
including line number, and the code dealing with that line, and a few
lines before / after it.
--
Burhan Khalid
phplist[at]meidomus[dot]com
Please add a reply-to: header
in your messages that points
to the mailing list address
so that all mail is properly
archived and viewed.