Code:
I'm having a problem. I'm sure I'm going to kick myself over the answer...
I have a table that stores vendors and their languages. This table starts out blank. I am querying the table to see if a vendor has been added to the table yet. The problem is, if they haven't been added, I can't seem to get the script to realize that. here is what I am trying to do.
$testvend = SELECT language FROM vendor_details WHERE id = $vendorid
if(!$testvend){
//script to add vendor to list, with supplied language
}else{
while($row = mysql_fetch_array($testvend)){
//script to get vendor language and display vendor langauge
}
}
Warning: mysql_fetch_arr ay(): supplied argument is not a valid MySQL result source in (script name) on line (line with mysql_fetch_arr ay)
*NOTE: I did try searching bytes.com and the web. The search on bytes.com returns a blank page. The web showed my method above, as well as the option to add "or die" after the query. adding or die didn't do anything either. I've also tried manually adding information to the table, so that the script is not working off of a blank table, but I still get the same result if the vendor does not exist. Also, I apologize that the title isn't very clear. I realized after I posted it I should have put a problem description in the title...
Comment