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.

Did you know?Explore Trending and Topic pages for more stories like this.
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 Like 36 Dislike
Previous forums Next forums
Other forums

Validation
Hello

I know this is a really vag question.

I need to have a input field on a form th

C problem struct and string
Hi guys,

This is my first post and I'm hoping the experts here can help me solve my problem.<

Why does first ever HttpSendRequest take longer?
I promise this isn't as simple as it sounds. I'm wondering why the the first ever call to HttpSendRe

Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site

check if value exists
I have googled this for a while and I am getting lots of different results. Is there a standard meth

need to add "sizes" to shopping cart
Hey guys, I am trying to figure out a way to add a "size" selector on to this bit of code.

Code doesn't print what i wanted it too. Please help!
Hi there,

I wrote this code to mae it so that in the form before it that the user said their

Connecion issue
Hi,

For some reason, I keep getting this error when trying to connect:

Warning: mysql_

Date Format
Hi there,

I have a date format like this right now:
Sat, 17 Oct 2009 17:04:00

I ne

how to load php class from another domain?
how to load php class from another domain?

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash