note 25440 added to control-structures.foreach
| From: | agudmundur at hotmail dot com | Date: | Tue, 24 Sep 2002 04:13:26 +0000 |
| Subject: | note 25440 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37168@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!!! :(
--
http://www.php.net/manual/en/control-structures.foreach.php
http://master.php.net/manage/user-notes.php?action=edit+25440
http://master.php.net/manage/user-notes.php?action=delete+25440
http://master.php.net/manage/user-notes.php?action=reject+25440