Link to home
Start Free TrialLog in
Avatar of breeze351
breeze351

asked on

Need another set of eyes on accessing variable.

I can't see what's wrong with this (the query is correct and returns 5000+ records).

$SqlString = "select * from comp";
$comp = $conn->query($SqlString);
$row_comp = $comp->fetch_array();
$work = $row_comp['TID'];

$work ends up as "TID"
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Looks fine from here.  What do you think it is supposed to do?
http://php.net/manual/en/mysqli-result.fetch-array.php
ASKER CERTIFIED SOLUTION
Avatar of Kim Walker
Kim Walker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of breeze351
breeze351

ASKER

BINGO!!!!!  Never would have thought of it.
Thanks
I tend to agree with Kim. It seems likely that at least one row in tour data contains the column names of your table.