Jump to content

MySQL mode


johnnyk

Recommended Posts

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

[code]
<?php
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);
print_r($row);
?>
[/code]
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.
Link to comment
https://forums.phpfreaks.com/topic/12787-mysql-mode/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.