Reply to newbie help with mysql_fetch_array

Your name:

Reply:


Posted by sixstringsin on 01/14/08 18:22

##in the mysql query below, i am selecting a few fields from the masks
table:-

$mask_query = "SELECT mask_id, mask_name, mask_dynamic FROM masks
where mask_project = $project_id AND mask_parent = $phase_id";

##next i am storing the return value to a variable (on executing the
script, I donot get any mysql error so i assume the query ran fine:-

$mask_res = mysql_query($mask_query) or die("can't run query
[$mask_query]: ".mysql_error());

##now i intend to print the field called mask_name on the browser:-

$tc_array = mysql_fetch_array($mask_res, MYSQL_ASSOC);
$tc_name = $tc_array["mask_name"];
print "mask Name:".$tc_array['mask_name'] . " ";


##However, what is printed is the string mask Name, followed by a
blank. The mask_name field from the db is ##not retrieved. Where am i
going wrong? Appreciate any help!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация