PlymWS
02-27-2008, 12:26 PM
I am trying to get a value from the VB database and compare it to a string submitted in a form.
The custom form takes an input from a form ($name). I want to compare $name, which will be an alphanumerical string, to userfield.field3 which is also an alphanum.
I have tried the following code but I get Resource id #18 instead of the actual value stored in the DB.
$name2 = $db->query_read("SELECT field3 FROM " . TABLE_PREFIX . "userfield WHERE userid = " . $vbulletin->userinfo['userid'] );
if $name !== $name2 {
do something; }
This doesn't work. I'm assuming I'm doing the SQL part wrong. Can someone put me right please.
The custom form takes an input from a form ($name). I want to compare $name, which will be an alphanumerical string, to userfield.field3 which is also an alphanum.
I have tried the following code but I get Resource id #18 instead of the actual value stored in the DB.
$name2 = $db->query_read("SELECT field3 FROM " . TABLE_PREFIX . "userfield WHERE userid = " . $vbulletin->userinfo['userid'] );
if $name !== $name2 {
do something; }
This doesn't work. I'm assuming I'm doing the SQL part wrong. Can someone put me right please.