I can't get the stuff out right!

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

I can't get the stuff out right!

Post by magicrobotmonkey »

Why does this:

Code: Select all

<?php $query1 = "SELECT carrier.Name, report.Act_Year
            FROM carrier, report
            WHERE carrier.NAIC = report.NAIC AND report.Sel_Year = 2004 AND report.Sel_Quarter = 1
            ORDER  BY report.Act_Year";
  $result1 = mysql_query($query1) or die ("Query failed: ". mysql_error());
  $carriers = mysql_fetch_array($result1);

var_dump($carriers);

?>
out put this:

array(4) { [0]=> string(28) " Stratford Insurance Company" ["Name"]=> string(28) " Stratford Insurance Company" [1]=> string(14) "20040406161410" ["Act_Year"]=> string(14) "20040406161410" }

Firstly, I know there are only three items in the DBase which will return when I run the same query from phpMyAdmin
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

Woops i just figured it out - heh, never mind!
Post Reply