note 25440 rejected from control-structures.foreach by nicos

From: Date: Tue, 24 Sep 2002 10:01:57 +0000
Subject: note 25440 rejected from control-structures.foreach by nicos
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-37173@lists.php.net to get a copy of this message
Some #$%#"#$ guy above posted this code: ------------------- <? $conn = pg_pconnect ("dbname=mydatabase"); $result = pg_exec ($conn, "select * from pamtest"); $numfields = pg_numfields ($result); $numrows = pg_numrows ($result); For ($i = 0; $i < $numfields ; $i++){ printf("<th bgcolor='silver'>%s</th>", pg_fieldname ($result,$i)); } print "</tr>\n"; For ($i=0; $i < $numrows; $i++){ $array = pg_fetch_row($result,$i); print "<tr>\n"; Foreach($array as $value){ echo "<td>".$value."</td>\n"; } print "</tr>\n"; } ?> ---------------------- Well i tried it on my page.. and then i discovered that all my db tables and data was missing and i had no user access any longer to do anything with my database. Im new to PHP and ewerything was going ok until i tryed this code... now i have lost ewerything thanks to this #$%&# guy who posted that code. And i dont have a clue what could possibly happenend :(( And by the way im using PHP - mySQL combination! When i try to create a simple table for example... i get this error messege... i have never had this before, until i tried that code above... the error msg is as follows: Error SQL-query: CREATE TABLE blabla (blabla TEXT not null ) MySQL said: Access denied for user: '****' to database '****' ARG!!! :(

« previous php.notes (#37173) next »