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
php wont update my db
hello,
sorry for posting in mysql forum but i dont know where exactly is the problem but here
TabControl Inside ListView Not Editing
Hello everybodyI have a ListView on my page. Inside the ListView I put a TabControl, cuz I want to p
What are the two different files you download to update kernel?
What are the two different files you download to update kernel?
Help With editting and deleting form
Hallo !!
So look at this image :
http://img194.imageshack.us/img194/8272/snapshot5f.pn
Help with syntax
Hi all!
The $bridge variable is not getting passed while it is contained in the line below:
PHP - HTTP Digest Authentication - Understanding Code Help
Hi Everyone,
This is my first time on your website and please excuse if I am asking silly que
how to get IP address?
hey guys,
i have this code which is supposed to get me the IP address of my site visitors:
trouble printing an array....
I'm having some trouble printing out an array forwards. I'm figuring out the high and low of an arra
Storing the referrer in session... problems with tabs
Hello All
I am currently working on an ERP project based on the MVC methodology, when a user
Renaming array keys
The issue: renaming array keys inside a foreach loop.
I'm trying to build a pie chart image w