MySQL5037srv//PHP522//WIN2KSP4//IISV5//***MySQL ERRORS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi to All,

I am having problems with the MySQL DB.  It started with this command from
a call in a PHP script...

"INSERT INTO docprouser (id,valid,password)VALUES
('user5','Y',md5('ksobhinyai'));" or die(mysql_error());"

The script actually connects with the DB fine and no errors at all.  You
can see the screen output in the attatched text file.  However, there is
no new entry in DB.

Upon looking at the error log for the specified time I get:

**Query Execute Thread cannot connect to MySQL **

However, if I cut/paste the above into the query window of GUI it executes
just fine, and shows the record written.

I've dnloaded the latest OBDC connector and set up correctly.
I've googled the MySQL errors to no avail.
TCP/IP is active on pc.
The tables were even created with this script.

I'm beyond frustrated, as two days now have been stuck with this DB
problem.  I just spent the last five or six hours deleting the DB off the
server and reloading it several times which cleared up several previous
problems.  Now, it comes down to this one.

Any help would be appreciated.
Blessings,
Chetan
<?php
        //$dtime = gmdate("D , M j, Y, g:ia", time()+(19800));
          $dtime = gmdate("g:ia", time()+(19800));
          $db = "aims site";
          $con = mysql_connect('localhost','root','pull3799') or die(mysql_error());
               echo "<h3>-ONE-Connected to Server!&nbsp$dtime</h3>";		
          
          
          if (!mysql_select_db($db,$con)){
               echo "Unable to select aims site DB<br>" . mysql_error();
                     exit;
          }    echo "<h3>-TWO-Connected to aims site DB!&nbsp$dtime</h3>"; 
         
         //*************************************************************************************
         //-- JUST TRYING TO STUFF DATA INTO DB,  TO SEE IF IT WORKS
         //*************************************************************************************
         //--  AS PROCESS IN WRITING LARGER PROGRAM
         //************************************************************************************* 

             mysql_query("CREATE TABLE IF NOT EXISTS docprouser ( 
             p_id int(11) NOT NULL auto_increment, 
             id varchar(20), 
             valid enum('y','n'), 
             password BLOB null, 
             timeEnter timestamp, 
             PRIMARY KEY (p_id)
             )
             ENGINE=MyISAM COMMENT='logon user & password';") or die('Create Died' . mysql_error());
             
             echo "<h3>-THREE-Step before data insertion into docprouser table!&nbsp$dtime</h3>";
            

              "INSERT INTO docprouser (id,valid,password)VALUES('user5','Y',md5('ksobhinyai'));" or die(mysql_error());                 "INSERT INTO docprouser (id,valid,password)VALUES('admin','Y',md5('srimatre'));" or die(mysql_error());
             "INSERT INTO docprouser (id,valid,password)VALUES
                                                                 ('user1','Y',md5('lalitambikayai'));" or die(mysql_error());
             "INSERT INTO docprouser (id,valid,password)VALUES('user2','Y',md5('hrdyayai'));" or die(mysql_error());
             "INSERT INTO docprouser (id,valid,password)VALUES('user3','Y',md5('ramyayai'));" or die(mysql_error());
             "INSERT INTO docprouser (id,valid,password)VALUES('user4','Y',md5('avaradayai'));" or die(mysql_error());
             "INSERT INTO docprouser (id,valid,password)VALUES('user5','Y',md5('ksobhinyai'));" or die(mysql_error());
             
             echo "<h3>-FOUR-Inserted data into docprouser table!&nbsp$dtime</h3>";
             
            if ($query="SELECT id, password FROM docprouser WHERE 'valid' = 'y'") {
               $result = mysql_query($query);
                 while ($logdata = mysql_fetch_row($result)) {
                    print("$logdata[0] $logdata[1]<br>\n");
                    break;
                   }
            }
            else   {
                    echo "<h3>-FIVE-There is no data in docprouser table!  We have a problem???!&nbsp$dtime</h3>"; 
                    break;
                   }

        
             echo '<p>Congratulations, database or table(s) have been created!</p>
	                 <p>You may now read the latest mail <a href="http://news.php.net/group.php?group=php.db";>PHP.NET</a></p>';
?>
******************************************************************************************************
BELOW IS THE SCREEN OUTPUT FROM ABOVE PHP PROGRAM
******************************************************************************************************

-ONE-Connected to Server!10:52am
-TWO-Connected to aims site DB!10:52am
-THREE-Step before data insertion into docprouser table!10:52am
-FOUR-Inserted data into docprouser table!10:52am

Congratulations, database or table(s) have been created!

You may now read the latest mail PHP.NET
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux