Read all data with empty fields.
Posted: Fri Oct 02, 2009 4:21 pm
Hey, Forgive me if this is a duplicate post but I'm in a real bind.
I have a DbaseIII table that has fields that have no data in them;
record 1 - 07 : honda : accord : 2 door : 1.5 : etc : etc
record 2 - 03 : toyota : 4runner : EMPTY : 2.3 : etc : etc
etc...
I need all the data in the records to be read even if blank/empty
here is my code:
if the $rs->Fields("field"); encounters an empty field then it just stops, dumps the entire record, and goes on to the next record.
I need it to just have a blank or NULL in the variable and retrieve the rest of the record data.
I have no choice in the way the data is retrieved, I CANNOT use a mySQL table or anything else because of where the data is being retrieved from,server constraints, etc.
I am new to PHP and dbase retrieval so I'm in a steep learning curve with this.
Thanks
I have a DbaseIII table that has fields that have no data in them;
record 1 - 07 : honda : accord : 2 door : 1.5 : etc : etc
record 2 - 03 : toyota : 4runner : EMPTY : 2.3 : etc : etc
etc...
I need all the data in the records to be read even if blank/empty
here is my code:
Code: Select all
$dbf = "c:\\inetpub\\wwwroot\\parts\\cardata";
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
$conn->Open("DRIVER={Microsoft dBase Driver (*.DBF)}; DBQ=$dbf");
$sql="SELECT * FROM main WHERE yr = '".$year."' AND make = '".$make."'";
$rs = $conn->Execute($sql);
$make = $rs->Fields("make");
$model = $rs->Fields("model");
$com = $rs->Fields("comments");
$notes = $rs->Fields("notes");
$manfpn = $rs->Fields("manfpn");I need it to just have a blank or NULL in the variable and retrieve the rest of the record data.
I have no choice in the way the data is retrieved, I CANNOT use a mySQL table or anything else because of where the data is being retrieved from,server constraints, etc.
I am new to PHP and dbase retrieval so I'm in a steep learning curve with this.
Thanks