ContactID is setup as a tinyint so I dropped the single ticks. No luck. I
ran the query in the MySQL client and got the ERROR 1054: Unknown column
'$ContactID' in 'where clause'.  I know the column ContactID exists.

Steve


"Josh Hoover" <[EMAIL PROTECTED]> wrote in message
E973048AB322D411AE99009027E32DF685CCF3@FRAZ">news:E973048AB322D411AE99009027E32DF685CCF3@FRAZ...
> In your query, do you need the single ticks around the $ContactID?  Is the
> ContactID column a char/varchar field which would require the single
ticks?
> I'm wondering if that's causing your problem.  Also, what if you do that
> query via the MySQL client?  What do you get then?
>
> Josh Hoover
> KnowledgeStorm, Inc.
> [EMAIL PROTECTED]
>
> Searching for a new IT solution for your company? Need to improve your
> product marketing?
> Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can
simplify
> the process for you.
> KnowledgeStorm - Your IT Search Starts Here
>
> > I'm trying to query my database to fill in data First Name
> > Last Name. Using
> > the script below I get (depending on the ContactID I enter)
> >
> > Contact: 1 1 or 2 2
> >
> > If ContactID=0 I get
> >
> > Contact:
> >
> > Any ideas on what I am doing wrong?
> >
> > Thanks.
> >
> > Steve Fitzgerald
> >
> >     <?php
> >     $sql="SELECT * FROM contacts WHERE ContactID='$ContactID'";
> >   $result = mysql_query($sql,$db);
> >
> >    printf("%s\n", mysql_result($result,"FirstName"));
> >
> > printf("%s<br>\n", mysql_result($result,"LastName"));
> >
> >
> >   ?>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to