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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Not being added 1

Status
Not open for further replies.

TheConeHead

Programmer
Joined
Aug 14, 2002
Messages
2,106
Location
US
code:
$stateN = $stateI;
$countyN = $countyI2;
$query = "INSERT INTO counties (state, name)";
$query .= "values ($stateN,$countyN)";
$resultAC = mysql_query($query);
if (!$resultAC) {
Print "Did Not Add";
}

I keep getting "Did Not Add" and it is not adding... I know it is connecting and I know the variable values are being gotten... any ideas why this would not work?

[conehead]
 
It's probably this part of your query concatenation:

$query .= "values ($stateN,$countyN)";

Unless the values in $stateN and $countyN are numbers, they will have to be enclosed in single-quotes.

I have a section on debugging database issues in my FAQ: faq434-2999

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top