We help IT Professionals succeed at work.

Need another set of eyes on accessing variable.

breeze351
breeze351 asked
on
65 Views
Last Modified: 2016-07-15
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"
Comment
Watch Question

Dave BaldwinFixer of Problems
CERTIFIED EXPERT
Most Valuable Expert 2014

Commented:
Looks fine from here.  What do you think it is supposed to do?
http://php.net/manual/en/mysqli-result.fetch-array.php
Web Programmer/Technician
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
BINGO!!!!!  Never would have thought of it.
Thanks
Ovid BurkeConsultant Instructor

Commented:
I tend to agree with Kim. It seems likely that at least one row in tour data contains the column names of your table.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.