Jump to content

[SOLVED] Simple query issue Mysql/PHP Can someone help


csolano702

Recommended Posts

We recently moved to another server and I think that new server we moved to may be setup incorrectly...

 

Issue: a simple query using "where" statements aren't working properly. I cant view any fields that are (int)

 

Example:  select * from banner where bannerid = '1'  (bannerid is an INT)

returns, Column "bannerid" not found

 

Example: select * from banner where displaybanner = '1'  (displaybannery is TINYINT)

displays mixed results some of which are '0'

 

if I do select * from banner and then show the field I see the data..

 

Am I going crazy? or is it a misconfiguration of PHP or Mysql or both? 

 

PHPVer 5.2.6

 

 

Full Code Example of a simple query that will just not run (Works if I copy and Paste query into phpmyadmin (which is hosted through another location other than our server)

 

mysql_connect($host, $user, $pass);

mysql_select_db('test');

$q = mysql_query("select * from banner where showbanner = '1' ");

while($row = mysql_fetch_array($q)){

    echo $row["name"];

}

 

 

Is it the version of php that is the problem or just config? can someone help i'm going crazy over this simple issue has anybody had this problem before?

==============================

From phpinfo()

 

mysql

MySQL Support enabled

Active Persistent Links  0 

Active Links  0 

Client API version  5.0.45 

MYSQL_MODULE_TYPE  external 

MYSQL_SOCKET  /var/lib/mysql/mysql.sock 

MYSQL_INCLUDE  -I/usr/include/mysql 

MYSQL_LIBS  -L/usr/lib/mysql -lmysqlclient 

 

Directive Local Value Master Value

mysql.allow_persistent Off Off

mysql.connect_timeout 60 60

mysql.default_host localhost localhost

mysql.default_password no value no value

mysql.default_port 3306 3306

mysql.default_socket /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock

mysql.default_user no value no value

mysql.max_links Unlimited Unlimited

mysql.max_persistent Unlimited Unlimited

mysql.trace_mode Off Off

 

 

 

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.