I wanna to know the difference between mysql_fetch_Assoc and mysql_fetch_Array..I am a little bit confused at its usage..Kindly provide with a sample example also...Any help would be appreciated

Member Avatar
Member Avatar
+0 forum 2

I have a loop that writes out data for franchises. It works the first time through, but not the 2nd. Here is the page where the data is written out: [URL="http://184.172.137.97/~royl21st/1.php"]http://184.172.137.97/~royl21st/1.php[/URL] Here is the code that spits out the wrong data after the first successful loop. Any ideas? [code] $areaCodeData = getData($sSql, $con, $dbName); $areaCodeRowCount = mySQL_num_rows($areaCodeData); $areaCodeRowCur = mysql_fetch_assoc($areaCodeData); if ($areaCodeRowCount != 0) { echo "<div class='box left'>"; // list all Area Codes for this Franchise echo "<div class='details'>"; $areaCodes = ""; for ( $ctrAreaCode = 0; $ctrAreaCode <= $areaCodeRowCount - 1; $ctrAreaCode += 1) { // grab AreaCodes …

Member Avatar
Member Avatar
+0 forum 3

For anyone still using the old "mysql_fetch_assoc" here is something I've just discovered today after about 9 years of PHP'ing and thought I should sahre because I've not seen many open source projects use it (maybe for another reason I'm not yet aware of)... (note: both provide the exact same output) [CODE] if ($no_of_records > 0) { $overhead_info = mysql_fetch_assoc($sql_result); extract($overhead_info); } echo "$rid, $type, $summary, $details, $cost, $purchase_date"; ############ instead of ############### if ($no_of_types > 0) { while ($overhead_type_info = mysql_fetch_assoc($sql_result)) { $rid = $overhead_type_info['row']; $type = $overhead_type_info['type']; $summary = $overhead_type_info['summary']; $details = $overhead_type_info['details']; $cost = $overhead_type_info['cost']; $purchase_date = …

Member Avatar
Member Avatar
+3 forum 14

The End.