Jump to content

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


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

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.