Just curious,
I'ved used the mysql statements from a procedural perspective and am now trying to use the mysqli object oriented functionality.
However I cannot seem to get it right.
I've checked input my Mysql PhpAdmin; my queries work; I've even tried my queries in the old mysql_query statements--they work.
I'll start from the top with a practice entry.
This select function works.
$mysqli=new mysqli("192.168.1.4","","","mediatv");
if(mysqli_connect_errno())
{
printf("Connection failed: %s\n",mysqli_connect_error());
exit();
}
printf("Host information:%s\n", $mysqli->host_info);
$query="SELECT * from tv_shows where title='NightCrawlers'";
$stmt=$mysqli->query($query);
$record=$stmt->fetch_array(MYSQLI_ASSOC);
echo "<br>" . $record[series];
$mysqli->close;
This update function does not seem to work.
$mysqli=new mysqli("192.168.1.4","","","mediatv");
$stmt=$mysqli->query('Update tv_shows set genre=\'chick flick\' where title=\'NightCrawlers\'');
$mysqli->commit();
echo "<br>" . $mysqli->affected_rows;
$mysqli->close;
'Update tv_shows set genre=\'chick flick\' where title=\'NightCrawlers\''
the query you see directly above was output from a phpadmin console. Removing the backslashes, etc does not seem to help result.
The output from a query that takes place after the update query is here.
Host information:192.168.1.4 via TCP/IP
Pete and Pete
teen comedy
I sincerely appreciate any input or comments.
Regards
Jason