Topic awaiting preservation: The connection to the server was reset while the page was loading. (Page 1 of 1) |
|
---|---|
Nervous Wreck (II) Inmate From: |
posted 06-01-2009 03:18
Please help i am working with php and using classes to build my site. code: require_once("include/database.php"); require_once("include/user.php"); if(isset($database)) { echo "true"; } else { echo "false";} echo "<br />"; echo $database->escape_value("It's working?<br />"); $sql = "INSERT INTO users (id, username, password, first_name, last_name) "; $sql .= "VALUES (1, 'username', '******', 'firstname', 'lastname')"; $result = $database->query($sql); $sql = "SELECT * FROM users WHERE id = 1"; $result_set = $database->query($sql); $found_user = $database->fetch_array($result_set); echo $found_user['username']; echo "<hr />"; $found_user = User::find_by_id(1); echo $found_user['username']; echo "<hr />"; $user_set = User::find_all(); while ($user = $database->fetch_array($user_set)) { echo "User: " . $user['username'] . "<br />"; echo "Name: " . $user['first_name'] . " " . $user['last_name'] . "<br /><br />"; }
code: echo "<hr />"; $found_user = User::find_by_id(1); echo $found_user['username']; echo "<hr />"; $user_set = User::find_all(); while ($user = $database->fetch_array($user_set)) { echo "User: " . $user['username'] . "<br />"; echo "Name: " . $user['first_name'] . " " . $user['last_name'] . "<br /><br />";
|
Bipolar (III) Inmate From: |
posted 06-01-2009 03:32
i feel stupid for some reason i search my brain for answer cant find any then post here... but as soon as i do i find the problem and am able to fix it. im sorry for wasting your time. thanks anyway |
Paranoid (IV) Inmate From: London |
posted 06-01-2009 11:22 |