Jump to content

[SOLVED] MySql and PHP question


makeshift_theory

Recommended Posts

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

I dont know how your Class is working
But 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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.