www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Same Db but errors

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Posts
    413

    resolved [RESOLVED] Same Db but errors

    Hi:

    I'm writing a cms to control some websites.

    I dumped a copy of the db on my local machine whilst i was developing it.

    Now i've connected remotely and the cms has gone haywire.

    It worked fine on my localhost.

    its a simple query:
    Code:
    //QUERY STRING TO GET ALL user INFORMATION FOR THIS user ID
    $query = "SELECT * FROM Users WHERE user = '" . $user . "'" ;
    
    //RUN QUERY AND STORE IN $result
    $result = mysql_query($query);
    
    //print
    while ($row = mysql_fetch_object($result))
    {
    	$user = $row -> user ;
    	$pass = $row -> pass ;
    	
    	echo $user . $pass ;
    	}
    its obviously connecting to the database (remote) becuase it would throw up an error, but i get:
    Code:
    Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\wamp\www\admin\logcheck.php on line 34
    so the query isn't working but its a simple table with 2 fields that works fine if the db is on my local machine.also i've checked that the table contains the user variable i'm using for the query.

    any help?

  2. #2
    Join Date
    Mar 2006
    Posts
    413
    Never mind i got it.

    For some reason on my local machine if the table name is 'users' or 'Users', it doesn't matter.

    on the remote db it has to be matching case.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles