MySQL Forums
Forum List  »  Perl

Re: table name as variable in INSERT
Posted by: Peter Brawley
Date: July 31, 2011 09:45AM

use Mysql;

$host = "localhost";
$db = "...";
$table = "test";
$usr = "...";
$pwd = "...";
$name = "Bob";
$connect = Mysql->connect( $host, $db, $usr, $pwd );
$connect->selectdb( $db );
$qry = "INSERT INTO $table VALUES ('$name');
$execute = $connect->query( $qry );

Options: ReplyQuote


Subject
Written By
Posted
B A
July 31, 2011 08:51AM
Re: table name as variable in INSERT
July 31, 2011 09:45AM


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.