Major Hooters
04-12-2007, 02:14 PM
Hey all,
mysql version 5.20, php 5
I just need a sanity check that what I am doing is not going to cause problems down the road. So any suggestions would be helpful. What I am doing is making multiple sql querys like this:
@ $db = new mysqli('localhost', 'blah', 'blah', 'blah');
$sql = "update sdata set description='".$description."' where refnum=" .$refnum;
$sql2 = "update sdata set datetime=now() where refnum=" .$refnum;
$result = $db->query($sql);
$result2 = $db->query($sql2);
if($result === FALSE)
{
die("Query failed: $sql <br>\n".$db->error);
}
if($result2 === FALSE)
{
die("Query failed: $sql2 <br>\n".$db->error);
}
if ($result and $result2)
{
*echo something back saying success!*
}
}
$result->free();
$result2->free();
$db->close();
Any Comments?? thanks!
mysql version 5.20, php 5
I just need a sanity check that what I am doing is not going to cause problems down the road. So any suggestions would be helpful. What I am doing is making multiple sql querys like this:
@ $db = new mysqli('localhost', 'blah', 'blah', 'blah');
$sql = "update sdata set description='".$description."' where refnum=" .$refnum;
$sql2 = "update sdata set datetime=now() where refnum=" .$refnum;
$result = $db->query($sql);
$result2 = $db->query($sql2);
if($result === FALSE)
{
die("Query failed: $sql <br>\n".$db->error);
}
if($result2 === FALSE)
{
die("Query failed: $sql2 <br>\n".$db->error);
}
if ($result and $result2)
{
*echo something back saying success!*
}
}
$result->free();
$result2->free();
$db->close();
Any Comments?? thanks!