Jump to content


MySQL mode

  • Please log in to reply
No replies to this topic

#1 johnnyk

  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 24 June 2006 - 06:02 AM

I'm having trouble setting and retreiving the MySQL mode. Based on what I read at mysql.org, this is what I wrote:

mysql_connect(blah blah blah);
mysql_select_db(blah blah blah);

mysql_query("SET GLOBAL sql_mode='strict_all_tables'");

$result = mysql_query("SELECT @@global.sql_mode;"); //also tried without semicolon, no difference
$row = mysql_fetch_array($result);
I'm getting "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in page.html"

Also, what is the difference between GLOBAL and SESSION. If I'm gonna be setting the mode after each connect, which one should I go with? Or does global eliminate the need to set the mode after every connect?

Any help would be appreciated. Thanks much.
Rediscover the Web:
<a href="http://www.spreadfir...;t=219"></a><br />

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users