Jump to content

No errors, but no update


angel_cowgirl

Recommended Posts

*sigh* seems like I can't find answers to anything on my own...sorry for asking so many questions..

 

I'm not getting any errors but its not updating the datbase either.

 

//Create an update query string with the updated horse data
$strUpdateQuery = "UPDATE horses SET horse_name = '".$strHorseName."', horse_dob = '".$intHorseDOB."', horse_sex = '".$strHorseSex."', horse_height = '".$intHorseHeight."', horse_color = '".$strHorseColor."', horse_sire = '".$strHorseSire."', horse_dam = '".$strHorseDam."' WHERE pk_horse_id = ".$intHorseID;

 

The variables are being passed from a form on the previous page, and I have checked the spelling and I've tried using only ' instead of " and ive tried using the query with out . around the variables but nothing.

 

Sometimes its actually not fun not getting errors...

Link to comment
Share on other sites

Your SQL is correct in code level, so can you post the code there.

 

Btw, did you check the connection to the database? do you set auto commit = false? The record is exist or not? did you try to pinrt the sql in the screen and check is it what you expect?

 

 

[!--quoteo(post=327327:date=Dec 14 2005, 02:57 AM:name=angel_cowgirl)--][div class=\'quotetop\']QUOTE(angel_cowgirl @ Dec 14 2005, 02:57 AM) 327327[/snapback][/div][div class=\'quotemain\'][!--quotec--]

*sigh* seems like I can't find answers to anything on my own...sorry for asking so many questions..

 

I'm not getting any errors but its not updating the datbase either.

 

//Create an update query string with the updated horse data
$strUpdateQuery = "UPDATE horses SET horse_name = '".$strHorseName."', horse_dob = '".$intHorseDOB."', horse_sex = '".$strHorseSex."', horse_height = '".$intHorseHeight."', horse_color = '".$strHorseColor."', horse_sire = '".$strHorseSire."', horse_dam = '".$strHorseDam."' WHERE pk_horse_id = ".$intHorseID;

 

The variables are being passed from a form on the previous page, and I have checked the spelling and I've tried using only ' instead of " and ive tried using the query with out . around the variables but nothing.

 

Sometimes its actually not fun not getting errors...

 

Link to comment
Share on other sites

//Call connection to database
require("Connect.php");

$intHorseID = $id;

//Update the Record

//Create an update query string with the updated horse data
$strUpdateQuery = "UPDATE horses SET horse_name = '".$strHorseName."', horse_dob = '".$intHorseDOB."', horse_sex = '".$strHorseSex."', horse_height = '".$intHorseHeight."', horse_color = '".$strHorseColor."', horse_sire = '".$strHorseSire."', horse_dam = '".$strHorseDam."' WHERE pk_horse_id = ".$intHorseID;

//execute the query
$rsModifyResult = ConnectDatabase($strUpdateQuery);

echo $rsModifyResult;

echo "<b><h3>Horse record successfully modified!</h3></b><br>";

 

gives me...

 

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Succeeded in connecting to the database.

 

1

Horse record successfully modified!

Link to comment
Share on other sites

thats all the info there is, in that file.

 

its not connectdatabase because the absolutely only thing that does is connect to the database and 1. it said it was successfully at doing so and 2. that function is used many many many times on every page of the site.

 

i actually did try running it in phpMyAdmin and hard coding values in works just fine

 

And as shown above the result of echoing it in IE was "1"... and when it does that it leaves that row blank in the DB

Link to comment
Share on other sites

Thank you for pointing out what a n00b I am, :) hehe. I had considered that before but for some how/ reason I got the impression it was happening somewhere in there but the more I read it the more I didn't see it I just hadn't tried it cause I was just sure there was something else I was missing.

 

Guess ya should always go with instinct and try EVERYthing even when ya dont THINK its right..

 

Anyway thanks again :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.