MySQL Forums
Forum List  »  MySQL Workbench

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

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
Views
Written By
Posted
Workbench 8.0 Utilities - copy as PHP code
616
August 27, 2022 06:59AM


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.