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

    Join Date
    Apr 2000
    Rep Power
    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
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

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

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


    Simon Wheeler
    FirePages -DHTML/PHP/MySQL

Similar Threads

  1. Replies: 1
    Last Post: January 30th, 2004, 11:46 AM
  2. not a valid MySQL result resource
    By alan1470 in forum PHP Development
    Replies: 2
    Last Post: November 30th, 2003, 08:55 PM
  3. Not a valid result resource
    By dodervang in forum MySQL Help
    Replies: 1
    Last Post: November 11th, 2003, 06: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, 11:31 AM
  5. Poor SQL Server Programming, Part 4
    By DavidM in forum MS SQL Development
    Replies: 0
    Last Post: October 21st, 2003, 10:28 PM

IMN logo majestic logo threadwatch logo seochat tools logo