Jump to content
Sign in to follow this  

MySQL query failing, please help

Recommended Posts

I wonder if somebody can help me please, I’ve got a website that has been working without any problems for over a year then the other day it stopped. I discovered that my hosts had changed things and the root directory was no longer the same. I updated this and the site is now back but all DB query’s are failing and I don’t know why. If I take the select query and run it direct in PHPMyAdmin then I get results but not he site I don’t so would be grateful for any assistance please.

I’m using this to connect:

function dbselect( $query,$dblink ) {
    if( $result=$GLOBALS[$dblink]->query( $query ) ) {
      while( $row=$result->fetch_array( MYSQLI_ASSOC ) ) { $dbdata[]=$row; }
      if( !isset( $dbdata ) ) { $dbdata=false; }
      if( is_object( $result ) ) {
      return( $dbdata );
    } else {
        logdberr( $query,'Query failed ('.$GLOBALS[$dblink]->error.')' );

It fails every time but if I run 

select * from feeds where product_feed_id=5671

 in PHPMyAdmin I get the product I’m after.

If it helps the version is 5.5.60-MariaDB

Thanks in advance

Share this post

Link to post
Share on other sites

Join the conversation

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

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Sign in to follow this  

  • Create New...