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
Applet JTextField Size Problem
Hello,
I recently started making an applet to calculate certain values for airplanes. However
Sharing PHP Sessions Across Domains
I am in the process of writing a script to share a php session across various domains I have.
The
array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I h
Wordpress IE issue
So I am trying to add the background shadow to my wordpress page. It works fine in Firefox but does
problem with php server update from mid 2009
Hi,
I have this navigation menu on 2 websites which used to work just fine. After a recent up
phpMailer not working ..........
HI,
I was playing with the phpMailer script and tried to send a smiple mail using their test scri
Re-Order by ID Number
I have a cms set up for inputting an image, thumb, title, pdf, and eps. When input the database ass
Header redirect
Hello ive got a problem ive got form with its action set to itself.
Code: <form id="f
user administration
Dear @all,
what I have to do to set the user defaults for new users. At the moment I woul
MSSQL/PHP
I am tryint to setup a webapplication developed in PHP, Apache2.0 and SQLServer2000 as backend which