|
Posted by dkruger on 10/09/07 21:04
On Oct 9, 10:17 am, Terry <w...@rogers.com> wrote:
> Hi folks.
> I am just starting to dabble in php.
>
> I am trying to do some simple pagination in php/mysql.
>
> For whatever reason I am only getting the first digit of my result.
>
> For example:
>
> $result = mysql_query("select lamp_no from lamps as l where id=20");
> $row = mysql_fetch_array($result);
> echo "20 = " . $row[0]['l']
>
> only displays 1 it should have displayed 15 for me.
>
> Thanks,
> Terry
Not from the way your query looks. what happens if you run that exact
query in your mysql client?
what I would try is run the query:
"select lamp_no as l from lamps where id=20"
with my suggestion, l will be used for the column name instead of
lamp_no. From the looks of your query, your column name would still
be lamp_no instead of l.
Navigation:
[Reply to this message]
|