on my local machine (with Apache 2.0, PHP 5.2.4 and MySQL 5.0) I come across weird things.
I have successfully made a table, but when I try to enter data into it it just will not accept the empty string for the first field (id).
This was the creation line:
QUOTE
$query="CREATE TABLE members (id int(20) auto_increment,first varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))";
This has created the table no problem.
However, when I try to enter something into that table with the following command:
CODE
$query = "INSERT INTO members VALUES ('','John','Barnes','01234 567890','00112 334455','01234 567891','johnbarnes@gowansnet.com','http://www.gowansnet.com')";
mysql_query($query);
if (@mysql_query ($query)) {
print '<p>The data entry was sucessful.</p>';
} else {
print "<p>Could not add the entry because: <b>" . mysql_error() . "</b>.
The query was $query.</p>";
}
mysql_close();
mysql_query($query);
if (@mysql_query ($query)) {
print '<p>The data entry was sucessful.</p>';
} else {
print "<p>Could not add the entry because: <b>" . mysql_error() . "</b>.
The query was $query.</p>";
}
mysql_close();
(and provision to see whether or not it succeeded), I get the following error:
Invalid value in id.
Then, when I try again, it does put data in, but in the wrong table, it either works or doesn't when I have to keep switching the opening tag from <? to <?php and back, ie. it says it has worked with the </ tag, but has not entered any data, then with the <?php tag, it tells me "Access denied", although correct username and password are in the script..
In other words, it seems like the whole system is running quite unstable.
I know I am not being very specific at times, but there is so much going on that i don't know what fault to post anymore.
Would it help if I posted a result from phpinfo()?
Thanks,
(Before I go completely nuts).

