Hi,
I am creating a script that will transfer database fields to uppercase but keep getting the following error message.
Couldn't execute query1.
here is a section of my code, the file mysqlconnectinfo.php has the database host and username password info etc as the variables stored in the connection variable.
include("mysqlconnectinfo.php");
// Create Connection
$connection = mysql_connect($dbhostname,$dbusername,$dbpassword) or die("Couldn't make connection.");
//Select Database
$db = mysql_select_db("db33996d", $connection) or die("Couldn't select database");
// create SQL statement
$sql = "SELECT ID, UserName, Password FROM Customer_Details ORDER BY 'ID'";
// execute SQL query and get result
$sql_result = mysql_query($sql,$connection) or die("Couldn't execute query.");
while ($row = mysql_fetch_array($sql_result)) {
$ID = $row["ID"];
$UserName = strtoupper($row["UserName"]);
$Password = strtoupper($row["Password"]);
$sql = "UPDATE Customer_Details SET UserName = '$UserName', Password = '$Password' WHERE ID = '$ID'";
// execute SQL query and get result
$sql_result1 = mysql_query($sql,$connection) or die("Couldn't execute query1.");
}
Any help would be greatly apreciated.
Yours sincerly,
Anthony Irwin