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

Redirecting Admin
In my members table, I have a field called "perm" and it's set to zero for all members. Ho

Problem!
I have another problem, when i run this code i get this error "Parse error: syntax error, unexp

Is this possible? If one file assigned to an ID...
I have a page that lists property listings assigned to a specific user (a manage page), with brief t

Run function every 5 mins ??
I have a function PostMessage()

How can I run it every 5 mins ??

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

Fetching array then reversing it
Hi, I have a simple problem, I'll try to explain it as best I can:
News entries in my database ar

paginate search result
Hi, I have a paginations script to display data from my database but i would like to paginate someon

Conditions of info record - Error
When i created GR (901) and PO create automatic my PBXX is obtain the net price of info record but

Retrieving the 25 most recently added entries from all tables in a MySQL databas
Hello,

The code below works great. It creates a table that shows the 25 most recently added t

line breaks in between fetched file names
Hi,

I have this code:
Code: <?php
if($dir = opendir('files')){
while (($f

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