Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT problem

Status
Not open for further replies.

knuckle05

Programmer
Dec 17, 2001
247
CA
HI All,

I'm not receiving an error on this, but no records are being added to my table. Please see code excerpt below:

Code:
<?php
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
   die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';

mysql_select_db("dbTourDates");

switch ($TransAction){
	case "Save":
		if ($lngNew == 1){
			$strSQL = "INSERT INTO tblArtists (ArtistName, Website) VALUES (" . $_POST['txtArtistName'] . ", " . $_POST['txtWebsite'] . ")";
		}
        mysql_query($strSQL);

		if (mysql_affected_rows() > 0){
			echo "Successs!";
		}


	break;

}

?>

Any help would be much appreciated.

Thx!

 
Ok thx,

Now I've got it working!

Forgot to put my values between single quotes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top