mysql query formating
Posted: Wed Aug 12, 2009 3:14 am
Hi, I am trying to get the query below to work and I am having no luck. I have tried writing it 50 different ways and nothing works.
All I end up with is "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in..."
I know what is below is not close to correct, I just left $type and $search there to show where they go.
The $type and $search are screwing it up, the query works fine if you were to substitute "name" for "$type" and "John Doe" for "$search"
Can anyone re write that so it actually works?
Thank you
All I end up with is "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in..."
I know what is below is not close to correct, I just left $type and $search there to show where they go.
The $type and $search are screwing it up, the query works fine if you were to substitute "name" for "$type" and "John Doe" for "$search"
Can anyone re write that so it actually works?
Code: Select all
$type = $_POST[type];
$search = $_POST[search];
$query = mysql_query("SELECT id, name, num, attend, phone, email, address FROM Invites WHERE $type LIKE $search");