angel_cowgirl Posted December 14, 2005 Share Posted December 14, 2005 *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... Quote Link to comment https://forums.phpfreaks.com/topic/3045-no-errors-but-no-update/ Share on other sites More sharing options...
leokwan1982 Posted December 14, 2005 Share Posted December 14, 2005 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... Quote Link to comment https://forums.phpfreaks.com/topic/3045-no-errors-but-no-update/#findComment-10191 Share on other sites More sharing options...
angel_cowgirl Posted December 14, 2005 Author Share Posted December 14, 2005 //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! Quote Link to comment https://forums.phpfreaks.com/topic/3045-no-errors-but-no-update/#findComment-10192 Share on other sites More sharing options...
leokwan1982 Posted December 14, 2005 Share Posted December 14, 2005 The info is not enought, can you show the code of ConnectDatabase? Moreover, try to echo the sql into screen and run it in MySQL client or phpMyAdmin. See is the sql run smoothly? if yes, the problem is raised by ConnectDatabase. Quote Link to comment https://forums.phpfreaks.com/topic/3045-no-errors-but-no-update/#findComment-10195 Share on other sites More sharing options...
angel_cowgirl Posted December 14, 2005 Author Share Posted December 14, 2005 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 Quote Link to comment https://forums.phpfreaks.com/topic/3045-no-errors-but-no-update/#findComment-10198 Share on other sites More sharing options...
ryanlwh Posted December 14, 2005 Share Posted December 14, 2005 have you retrieved the data from the $_POST array? it seems that you're passing in empty strings. Quote Link to comment https://forums.phpfreaks.com/topic/3045-no-errors-but-no-update/#findComment-10210 Share on other sites More sharing options...
angel_cowgirl Posted December 14, 2005 Author Share Posted December 14, 2005 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 Quote Link to comment https://forums.phpfreaks.com/topic/3045-no-errors-but-no-update/#findComment-10213 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.