MySQL Forums
Forum List  »  MySQL Workbench

Re: Workbench 8.0 Utilities - copy as PHP code
Posted by: Philip Burness
Date: August 31, 2022 05:20AM

Hi Peter,
when copying as PHP code from the tools -> Utilities menu and pasting the subsequent copy into an editor you get something along the lines of :-

$query = "SELECT * FROM mydb.table";


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

The $con, $query $field etc variables must be defined somewhere - so is this editable within the workbench config files somewhere and if so where?

Phil

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Workbench 8.0 Utilities - copy as PHP code
240
August 31, 2022 05:20AM


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.