mysql_affected_rows() usage
Posted on
16th Feb 2014 07:03 pm by
admin
Possibly a MySQL issue, but the function that is not behaving in the anticipated way is a PHP function.
Seems as though mysql_affected_rows() is not returning the desired number so I can move into my if statement.
This is just a snippet. Let me know if more code might be needed to diagnose.
Code: <?php
dbconnect();
$sql = "INSERT INTO `registration` (`id`, `the_date`, `first_name`, `last_name`, `email`, `phone`, `street_address`, `city`, `state`, `zip`, `emergency_contact`, `emergency_phone`, `high_school`, `test_score`, `major_interest`, `gpa`, `activity1`, `activity2`, `activity3`, `activity4`, `recruitment`, `recruitment_explain`, `travel`, `language`, `language_years`, `rotc`, `interests`, `accommodations`, `pay`) VALUES (NULL, '{$the_date}', '{$first_name}', '{$last_name}', '{$email}', '{$phone}', '{$street_address}', '{$city}', '{$state}', '{$zip}', '{$emergency_contact}', '{$emergency_phone}', '{$high_school}', '{$test_score}', '{$major_interest}', '{$gpa}', '{$activity1}', '{$activity2}', '{$activity3}', '{$activity4}', '{$recruitment}', '{$recruitment_explain}', '{$travel}', '{$language}', '{$language_years}', '{$rotc}', '{$interests}', '{$accommodations}', 'N')";
$result = mysql_query($sql) OR DIE ('//INSERT error<br />Please report this to the site admin <a href="/contact/index.php">here</a>.<br /><br />'.mysql_error());
if (mysql_affected_rows($result)==1)
{
//send email
?>
No comments posted yet
Your Answer:
Login to answer
279
36
Other forums
foreach loop, assistance request
I would like some guidance on the usage of foreach as I try to parse through a large database and wh
TinyMCE / Ajax Postback Problem
Hiya all,
I have a page which loads the TinyMCE editor. On the postback I obviously want to f
if description does not contain the following words
Hello everyone,
I am parsing a MS Excel (.xls) file and adding it's content to a mySQL databa
Syntax Help
Code:
im having trouble with that code snipped
Parse error: syntax error, unexpec
IP Based Cron Jobs
I run cronjobs on my website. After one of my visitors got curious and tinkered around he realized h
Function module "DPS_CHECK_TABLE_EXISTS" not found (after OSS 1422843 impl)
Dear All,
I implemented Note OSS 1422843.
When i execute the new report RSPO20
Why use interfaces in PHP (OOP)
I am learning OOP in PHP and its been a pretty good learning experience so far. What I didn't unders
webpage with (simple) login & mysql-db
Hi all,
What I was looking for before was a multi-user password manager, web-based! The offer
Undefined Variable: PHP_SELF, pls help
Hi,
Im a newbie on PHP / MySQL programming and Im running a script to search one field on my
Find current logon time
Hi,
in my sql script i want to query and find out the logon time of the current session.
<