MySQL Forums
Forum List  »  Newbie

Workbench 8.0 Utilities - copy as PHP code
Posted by: Philip Burness
Date: August 27, 2022 01:01AM

Is it possible to change & store the default variables used anywhere?

i.e. $con, $query

See below.

Thanks

$con = new mysqli($host, $user, $password, $dbname, $port, $socket)
or die ('Could not connect to the database server' . mysqli_connect_error());

//$con->close();

$query = "SELECT * FROM combat";


if ($stmt = $con->prepare($query)) {
$stmt->execute();
$stmt->bind_result($field1, $field2);
while ($stmt->fetch()) {
//printf("%s, %s\n", $field1, $field2);
}
$stmt->close();

Options: ReplyQuote


Subject
Written By
Posted
Workbench 8.0 Utilities - copy as PHP code
August 27, 2022 01:01AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.