Connection code:
Code: Select all
$link = mysqli_connect('localhost', 'userid','password','Uno8s');
if (mysqli_connect_errno()) {
echo "Connect failed: " . mysqli_connect_errno() . " " . mysqli_connect_error() . "<br />";
exit();
}
Code: Select all
$MySQL = "UPDATE chatTbl set chatStream = '" . $fndChatStream . "\n" . $handle . " " . $inDate . " " . $inTime . "\n" . $inMessage . "' WHERE ID = 1";
if ($result = mysqli_query($link, $query)) {
if (mysqli_affected_rows($link) > 0) {
$numInserted_rows = 1;
}
else if (mysqli_affected_rows($link) == 0)
$numInserted_rows = 0;
else $numInserted_rows = -1;
}
else $numInserted_rows = 0;
Code: Select all
$numInserted_rows = mysqli_affected_rows($link);
Code: Select all
$query = "SELECT c.gameID, c.date, c.time, c.chatStream from chatTbl c WHERE c.gameID = " . $inGameID ;
if ($result = mysqli_query($link, $query)) {
$numChat_rows = mysqli_num_rows($result);
}
else $numChat_rows = 0;
if ($numChat_rows > 0) {
$row = mysqli_fetch_assoc($result);
$fndID = $row["ID"];
$fndGameID = $row["gameID"];
}