-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.php
More file actions
26 lines (18 loc) · 871 Bytes
/
example.php
File metadata and controls
26 lines (18 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
// WARNING
//
// Do not run this script "as is". This may damage permanently your database.
// Also, try to not use this class on a production database.
// Use only the script lines you want, not the whole script.
require('dbpopulator.class.php');
$db = new DBPopulator();
$db->setDb('localhost', 'root', 'root');
// You can either use 'database.table' or 'database.*'
$db->populate('mydb.mytable');
$db->populate('mydb.*');
// And you can also use any combination of these methods, using an array
$db->populate(array('mydb.table', 'another_db.*'));
// It's possible to define the number of inserted data
$db->populate('mydb.mytable', 20);
// And you can generate a file with the insert statements
$db->populate('mydb.mytable', NULL, 'dummy_inserts.sql');