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

Two warning messages
Quote<b>Warning</b>: mysql_real_escape_string() expects parameter 1 to

Session variable help
I'm having a very troubling issue. Maybe I'm just looking over something but I have looked at the co

Issue Parsing XML into table
Hello all,

Im a bit new to php and new to phpfreaks. But thanks in advance for the help!
<

asking for direction
I have 2 tables in my data, which are "post" and "event"
I won't make a summa

Getting a variable to work in function params
I have this fuction which is inside a class:

Code: public static function generateEmbedCode($

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

Problem with creating FI documents
Hi, Experts!

when i create Fi doc. with standart transaction, i ve been had such problem

What are the two different files you download to update kernel?
What are the two different files you download to update kernel?

help with mysql_error()
Hi,

I am trying to insert data into a table, but I am not able to insert it. I wanted to see

Display the user's weight lost in the past week
Hello everyone,

I am working on a weight loss app for my site, and I want to display the user

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