If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Mysql problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-30-06, 14:51
Geronimo1964 Geronimo1964 is offline
Registered User
 
Join Date: May 2006
Location: Almere
Posts: 1
Mysql problem

My knowledge of mysql is very poor and with the knowledge i have, i can't solve the problems i'm facing with my linuxserver.

Almost every php script which uses a mysql database doesn't work and I really don't know what the problem is since there is no error report.
When i make a database for a new script, the tables will be filled and there is a connection. But when i try to run the script there's nothing happening.

Normally the script should get all the info from the tables but not in this case.

Can anybody tell me what the problem can be?
Reply With Quote
  #2 (permalink)  
Old 05-30-06, 16:15
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,260
without detailed knowledge no, I can't help, and I'm guessing no one else can give a defintive answer

what error meesages are you getting

hint look at the php construct of
<php statement> or die (error message)

I often use soemthing similar to...
Code:
$cnn=@mysql_connect($host,$UID1,$PWD1) or die("E:xxxx - Failed to open cn:$cnn ".mysql_errno().": ".mysql_error()));
$dbr=@mysql_select_db($dbn,$cnn) or die ("E:yyyy - Failed to open db:$dbr ".mysql_errno().": ".mysql_error()));
$sql = "
 Select * from DT_Event
 where Event_End>=curdate() or (Event_End is Null and Event_Start>-curdate())
 order by Event_Start,Event_End,Event_Name";
// where Event_End>=curdate()
$sqlr=@mysql_query($sql,$cnn) or die ("E:zzzz - Failed to open rs:$sqlr ".mysql_errno().": ".mysql_error()));
if (@mysql_num_rows($sqlr)>0) {
} else
{ //insert debug mesage to show no records returned
}
my first / best guess is going to be that you probabkly haven't given the correct permissions to the web userid. if so check you grants
failing that it could be that the mysql isnt running on your machine. check you can use MysQL adminsitrator
check that MySQL runs on ther command line / shell
there are ffectively 3 steps to ensure the php module is "talking" to the db server
the connection - fails if permissionsa arn't correct
the database -fails if the db isn't working, or if the permissions aren't correct
the sql - fails if the SQL isn't valid.
in nay event you need to know what is causing the problem - examining the mysqlerrno() and mysqlerror() should give a clue.
like all software products occasionally the error message can be a bit cryptic but it will point you nt he right direction.

if you can run mysql admin or mysql query browser AND connect tohe locsal host then by defintion the server is active that demonstrates the problem is likely to be in the permissions ofr th euser account and password specified. in this event either GRANT permissions or use mysql admin to handle the permissions

aftert that it becoems a PHP problem, and youmay be better off asking the question on the php thread rather than the MySQL thread.

HTH
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On