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
 36  
 
    
    
 
Other forums
present value of sequence?   
Hi
Please help me to find out the present value of sequence?
Thanks
 formating when pulling data from a mysql database
 
Ok so Im not to sure if this is the right thread to post in but here is my catch 22 issue.
I 
add 20 000 to the rowcnt 
Hi ...
 I need to add 20 000 to the row count but just cant find a way to do this i am new to php
php redirecting 
i wont open a new thread but i have a question about redirecting....
i wonder why my code doesnt 
Security Exception on pages using AJAX 
I am getting the exception: attempted to perform an operation not allowed by the security policy on 
session checking in page load 
hai all
              I have a web site is www.Mryas.com in this my login page is Page1.aspx its co
Upload Code Help 
Hi everyone I need some help with a bit of code ive been working with for a while. I am completely s
Load file in PHP 
I have 2 files. The first is a PHP generated XML file that's dependent by 2 inputs. The second is a 
php slowing my site? 
Hi all,
I think that one of the reasons that my site doesn't work fast is that the code is ve
listcube issue 
Hi 
I have a virtual cube ZREMOTE.  I use Tcode "listcube" to retrieve contents.  I use of the