Topic awaiting preservation: phpMyAdmin questions |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: 1393 |
posted 01-10-2006 07:24
I've found more time to dabble with php/mysql so be patient with me code: <?php require("functions.php"); $update = $_GET['update']; connectDB(); $query = "SELECT * FROM contentTable WHERE page='$update'"; $result = mysql_query($query); $num = mysql_numrows($result); if ($num == 0) { $query = "INSERT INTO contentTable VALUES ('', '$update', 'Add Page Content Here')"; mysql_query($query); } mysql_close(); for ($i = 0; $i < $num; $i++) { $id = mysql_result($result, $i, "id"); $page = mysql_result($result, $i, "page"); $content = mysql_result($result, $i, "content"); } echo 'Update <b>' . $page . ' Page</b><br><br>'; ?>
|
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 01-10-2006 09:55
ok... you need a mysql->text or mysql->largetext column to store text (use a blob though, if it's binary. text fields in mysql are stripped from trailing whitespace.) |
Paranoid (IV) Inmate From: 1393 |
posted 01-11-2006 05:48
k - updated my content type to longtext and added error_reporting ( E_ALL ); to the first of my script but no errors are generated. Also, reading here it talks about a text field being "indexed" (about the fourth <p> down)... what exactly does that mean? I know a can index columns with the phpMyAdmin actions... does this help speed things up? |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 01-11-2006 09:53
indexing can speed things up if you're using select where xyz = tyb (or > or < or => or <=) queries... |
Paranoid (IV) Inmate From: 1393 |
posted 01-20-2006 02:56
Forgot to thank you... really helped me out a lot; thanks! |