Do you have a question? Post it now! No Registration Necessary. Now with pictures!
March 17, 2006, 10:05 pm
rate this thread
$qry = mysql_query($sql) or die("Query not valid: " . mysql_error());
$res = mysql_fetch_object($qry);
// This returns a row with a field 'Type' containing 'enum(...)'
$res->Type = str_replace('enum('', '', $res->Type);
$res->Type = str_replace('')', '', $res->Type);
//now the string is something like this: one','two','three
$temp = explode('','',$res->Type);
//temp is an array with as much elements as the enum
This way is much more easier using the elements since they are elements
of an array. Cleaver isn't it?