#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    3
    Rep Power
    0
    Hi there,

    I have a form that allows a user to enter their name, it passes this forward as $name.
    When I do this: $result = mysql_query("SELECT * FROM people WHERE name=$name",$db);

    I get this: Warning: Supplied argument is not a valid MySQL result resource

    If I change my select statement and hardcode in the name EG: 'amber' then it works ?!?!!
    Please help I have messed around for days with this one !
    Thank you
    Amb
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    you need to put ' ' around your variable ie:

    ("SELECT * FROM people WHERE name='$name'",$db);

    Regards,
    Simon.


    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL

Similar Threads

  1. Replies: 1
    Last Post: January 30th, 2004, 12:46 PM
  2. not a valid MySQL result resource
    By alan1470 in forum PHP Development
    Replies: 2
    Last Post: November 30th, 2003, 09:55 PM
  3. Not a valid result resource
    By dodervang in forum MySQL Help
    Replies: 1
    Last Post: November 11th, 2003, 07:29 PM
  4. Argh! - Supplied argument is not a valid MySQL-Link resource
    By eanicklaus in forum PHP Development
    Replies: 6
    Last Post: November 5th, 2003, 12:31 PM
  5. Poor SQL Server Programming, Part 4
    By DavidM in forum MS SQL Development
    Replies: 0
    Last Post: October 21st, 2003, 11:28 PM

IMN logo majestic logo threadwatch logo seochat tools logo