XAMPP PHP/MySQL/APACHE Question v1.8.1
Posted: 29. December 2012 07:51
I downloaded and successfully installed XAMPP 1.8.1 on my Windows 7 64bit machine recently. My question is that 'occasionally', I seem to write to the MySQL database but upon running a query, the entry isn't there. It only happens now and then and usually, after I've already successfully written something to the database as in, on the second or third attempt.
Here's some of my PHP code:
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
mysql_select_db($DBname) or die("Unable to select database $DBname");
if (mysqli_connect_errno())
{
echo 'Error: Could not connect to database.';
exit;
}
$sqlquery = "INSERT INTO $table VALUES('$id', '$event', '$date', '$name', '$year')";
$results = mysql_query($sqlquery);
mysql_close();
Oddly, no errors and the write always appears successful.
Some specifics on how I have the MySQL db table set up:
input text fields with a varchar type (except ID which is int). ID is primary key and default is 'latin1' with 'latin1_swedish_ci' collation. In matching another XP WAMP system that has worked flawlessly, I set the engine to MyISAM
Any ideas as to why it would only write to the database occasionally anyone?
TIA
Here's some of my PHP code:
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
mysql_select_db($DBname) or die("Unable to select database $DBname");
if (mysqli_connect_errno())
{
echo 'Error: Could not connect to database.';
exit;
}
$sqlquery = "INSERT INTO $table VALUES('$id', '$event', '$date', '$name', '$year')";
$results = mysql_query($sqlquery);
mysql_close();
Oddly, no errors and the write always appears successful.
Some specifics on how I have the MySQL db table set up:
input text fields with a varchar type (except ID which is int). ID is primary key and default is 'latin1' with 'latin1_swedish_ci' collation. In matching another XP WAMP system that has worked flawlessly, I set the engine to MyISAM
Any ideas as to why it would only write to the database occasionally anyone?
TIA