What am I doing wrong? [beginner]
| From: | Martin Johansson | Date: | Fri, 19 Jul 2002 15:20:34 +0000 |
| Subject: | What am I doing wrong? [beginner] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108526@lists.php.net to get a copy of this message | ||
AHHHHHRGGG this is getting me on my nerves!!!##!!
I am using a mySQL-databasetable called controllpoints_tbl with the
following structure:
+----+------------+-----------+-----+------+-----+--------------------------
---------------------------+
| nr | process_nr | type | abb | name | x | description
|
+----+------------+-----------+-----+------+-----+--------------------------
---------------------------+
| 1 | 1 | Milestone | MS | MS1 | 200 | bla bla bla
|
| 2 | 1 | Milestone | MS | MS2 | 500 | bla bla bla
|
| 3 | 1 | Tollgate | TG | TG1 | 100 | bla bla
bla |
| 4 | 1 | Milestone | MS | MS4 | 600 | bla bla bla
|
+----+------------+-----------+-----+------+-----+--------------------------
---------------------------+
I want to view just the "name" and "x" variable with this code...
for ($i=1;$i<=$antal_typer;$i++)
{
$typvar = $type[$i]; // this is an array with types
$here = 150+17*$i;
echo "Hello";
$result = mysql_query("select name,x FROM controllpoints_tbl where
process_nr=$process_nr and type=$typvar order by x");
while ($myrow = mysql_fetch_row($result)) // this is line
138...
{
// here's a lot of code..
}
}
but it never enters the while loop.. and only print Hello one time although
$antal_typer = 2;
a warning message says:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in c:\inetpub\wwwroot\devproc\beta\view.php on line 138