-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestdb.php
37 lines (29 loc) · 908 Bytes
/
testdb.php
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
27
28
29
30
31
32
33
34
35
36
37
<h1>Pruebas de base de datos</h1>
<?php
include 'extensions/db/dbscheme.class.php';
include 'extensions/db/mysql_db.plugin.php';
include 'extensions/db/db.php';
/*db::connect('name1', 'mysql', 'localhost', 'pruebas', 'root', 'test');
db::createcommand('SELECT * FROM alumnos', 'name1')->execute();
*/
$db = new mysql_db();
$db->connect('localhost', 'pruebas', 'root', 'test');
$t = $db->createcommand('SELECT * FROM alumnos', 'name1');
while ($row = mysql_fetch_assoc($t)) {
print_r($row);
echo '<hr />';
}
echo '<h2>Other</h2>';
$db2 = new mysql_db();
$db2->connect('localhost', 'arrayzone', 'root', 'test');
$t = $db2->createcommand('SELECT * FROM az_users', 'name1');
while ($row = mysql_fetch_assoc($t)) {
print_r($row);
echo '<hr />';
}
/*echo '<h2>Another</h2>';
$t = $db->select(array('*'))->from(array('cargos'));
while ($row = mysql_fetch_assoc($t)) {
print_r($row);
echo '<hr />';
}*/