makeshift_theory Posted December 27, 2006 Share Posted December 27, 2006 Ok I have this query here:[code]$this->do_query("ALTER TABLE `templates` CHANGE `$realname` `$name` SMALLINT( 1 ) NOT NULL DEFAULT '2'");[/code]It runs fine and dandy however is there a way to check to see if the altercation was successfull? Obviously mysql_affected_rows will not work since it's not changing a row but altering the structure of the row. I really don't want to have to call a select query just to check to see if the name was changed successfully. Link to comment https://forums.phpfreaks.com/topic/31968-solved-mysql-and-php-question/ Share on other sites More sharing options...
onlyican Posted December 27, 2006 Share Posted December 27, 2006 I dont know how your Class is workingBut I would do something like[code]<?php$query = "ALTER TABLE `templates` CHANGE `$realname` `$name` SMALLINT( 1 ) NOT NULL DEFAULT '2'";$result = mysql_query($query);if($result){echo "Query done";}else{echo "There was a problem running the query.<br />\n".mysql_error();}[/code] Link to comment https://forums.phpfreaks.com/topic/31968-solved-mysql-and-php-question/#findComment-148362 Share on other sites More sharing options...
makeshift_theory Posted December 27, 2006 Author Share Posted December 27, 2006 Duh I didn't think about that, too much other stuff going on in that code for me to look at the basics. ::) Thanks a bunch. Link to comment https://forums.phpfreaks.com/topic/31968-solved-mysql-and-php-question/#findComment-148424 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.