Re: Weird Problem
| From: | David Nicholson | Date: | Tue, 29 Jul 2003 19:44:59 +0000 |
| Subject: | Re: Weird Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157413@lists.php.net to get a copy of this message | ||
Hello,
This is a reply to an e-mail that you wrote on Tue, 29 Jul 2003 at
20:40, lines prefixed by '>' were originally written by you.
> I have the following chunk of code:
> $sql = "SELECT setting from settings where
name='display_rows'";
> include("connect.inc.php");
> print $sql;
> $row = mysql_fetch_row($result);
> $path = $row[0];
> print $path;
> It always prints out "1"
> But if I run the code at the sql command prompt, it prints out
"25",
> which is the correct value.
> Does anyone have any ideas why im having this problem??
> - ---
Unless it is done within connect.inc.php you have not executed your
query. Maybe the last query you executed has a row containing the
value 1 ready to be fetched?
Try adding $queryid = mysql_query($sql); before $row =
mysql_fetch_row($result);
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/
(developed entirely in PHP)