Page 1 of 1

feych_stuff and a function

Posted: Fri Jul 20, 2007 12:31 pm
by m2babaey
Hi
1.what is the difference between mysql_fetch_array, mysql_fetch_assoc and mysql_fetch_row?
2. I know what mysql connect is but what is the next line doing in the code below:
function db_connect($host,$user,$pass) //create connection

Code: Select all

{
	$r = mysql_connect($host,$user,$pass);
	if(preg_match('/^5\./',mysql_get_server_info($r)))db_query('SET SESSION sql_mode=0');
	return $r;
}

Posted: Fri Jul 20, 2007 12:37 pm
by UrButtFullOfArr0ws
http://www.php.net/mysql_fetch_assoc
http://www.php.net/mysql_fetch_array
http://www.php.net/mysql_fetch_row
Not to be rude or anything but next time try to check php.net and Google before posting :?

Posted: Fri Jul 20, 2007 2:27 pm
by volka
if(preg_match('/^5\./',mysql_get_server_info($r)))db_query('SET SESSION sql_mode=0');
If the script has connected to a mysl 5.x server it (re)sets the sql mode. see http://dev.mysql.com/doc/refman/5.0/en/ ... modes.html