LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-29-2004, 08:53 AM   #1
caged
Member
 
Registered: Jan 2004
Location: new zealand
Distribution: Mandrake,Slackware
Posts: 165

Rep: Reputation: 30
MySQL errors on slack server.


Hi im having some problems copying my web pages over from my windows with php-triad computer to my slackware computer running the same three programs but not all pre-config-d. the problem (this time) is with sql.
MySQL is having problems on the slackware machine that its not having on the windows comp i made the pages on.

I copied the databases across using phpmyadmin and i can see the database there and export it from there to.

the error mysql is spitting at me on the slackware comp is:
Code:
Warning: mysql_fetch_array(): supplied argument is not a 
valid MySQL result resource in /var/www/htdocs/blah/scan.inc on line 9
im not really sure where to start looking can anybody tell me what this error suggests?

cheers,
Ben.

Last edited by caged; 10-29-2004 at 09:09 AM.
 
Old 10-29-2004, 01:08 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
What's the command you're trying to run?
 
Old 10-29-2004, 11:41 PM   #3
caged
Member
 
Registered: Jan 2004
Location: new zealand
Distribution: Mandrake,Slackware
Posts: 165

Original Poster
Rep: Reputation: 30
sure.
Code:
  <?
  {
  $db = mysql_connect("localhost", "changed", "changed");
  mysql_select_db("maindb",$db);
  $ip = getenv("REMOTE_ADDR");
  if($loginName){

    $result = mysql_query("SELECT * FROM users",$db);
->  if ($myrow = mysql_fetch_array($result)) {
        do {
cheers.
 
Old 10-30-2004, 07:05 AM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
It looks absolutely OK. Maybe check the value of $result after mysql_query(), but it should be correct. Or...not?
 
Old 10-30-2004, 10:37 PM   #5
m_shroom
Member
 
Registered: Oct 2004
Location: Queen Charlotte B. C. Canada
Distribution: openSUSE 11.1
Posts: 42

Rep: Reputation: 15
For debuging you should add to your code, in case your not connecting
PHP Code:
 $db mysql_connect("localhost""changed""changed") or die ("can not connect to server");
  
mysql_select_db("maindb",$db) or die ("can not select DB") ; 
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
Fedora Core 3, MySql Server, mysql started mysql ended OkiTek Fedora 30 01-28-2005 09:15 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration