close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Odd recordset results

Thread began 5/18/2018 2:04 pm by vernon webb | Last modified 5/21/2018 2:55 pm by Ray Borduin | 76 views | 11 replies |

vernon webb

Odd recordset results

I know this is kind of outside the WebAssist ext but hoping you could help me. I had this code working with the old version but after the recordset was changed it broke so I recreated a fake area I wanted repeated and wrapped it around this code. It basically writes the results returned to a csv file, but for some reason it writes the same record over and over:

<?php
$fp = fopen($fileName, "w");
fwrite($fp,"Pub Name,Advertiser,Title,Insert Date,Our IO #,Your ID #,Check Num,Completed?,Canceled,Cost\n");

$wa_startindex = 0;
while(!$rsRESULTS->atEnd()) {
$wa_startindex = $rsRESULTS->Index;

$job_orderID = $rsEXPORT->getColumnVal('orderID');
$job_date = $rsEXPORT->getColumnVal('start_date');
$job_media_cost = $rsEXPORT->getColumnVal('media_cost');
$job_company = $rsEXPORT->getColumnVal('company');
$job_pub_name = $rsEXPORT->getColumnVal('pub_name');
$job_job_title = $rsEXPORT->getColumnVal('job_title');
$job_start_date = $rsEXPORT->getColumnVal('start_date');
$job_invoiceNUM = $rsEXPORT->getColumnVal('invoiceNUM');

if ($rsEXPORT->getColumnVal('pub_inv_num') != "0") {
$job_pub_inv_num = $rsEXPORT->getColumnVal('pub_inv_num');
} else {
$job_pub_inv_num = "";
}
if ($rsEXPORT->getColumnVal('rs_check_num') != "0") {
$job_rs_check_num = $rsEXPORT->getColumnVal('rs_check_num');
} else {
$job_rs_check_num = "";
}
if ($rsEXPORT->getColumnVal('complete') == "0") {
$job_complete = "NO";
} else {
$job_complete = "YES";
}
if ($rsEXPORT->getColumnVal('killed') == "0") {
$job_killed = " ";
} else {
$job_killed = "YES";
}
if ($rsEXPORT->getColumnVal('mailed') != "0") {
$job_mailed = $rsEXPORT->getColumnVal('mailed');
} else {
$job_mailed = " ";
}

$job_company = preg_replace("/,/", "", $job_company);
$job_job_title = preg_replace("/,/", "", $job_job_title);
$job_pub_name = preg_replace("/,/", "", $job_pub_name);

fwrite($fp, "$job_pub_name,$job_company,$job_job_title,$job_date,$job_orderID,$job_pub_inv_num,$job_rs_check_num,$job_complete,$job_killed,$job_media_cost,$job_mailed,$job_invoiceNUM,\n");

$rsRESULTS->moveNext();
}
$rsRESULTS->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);

fclose($fp); ?>

Sign in to reply to this post

Ray BorduinWebAssist

You are looping on $rsRESULTS but adding data from $rsEXPORT.

You would need to loop on the same recordset you are getting content from for the rows to change.

Sign in to reply to this post

vernon webb

Because I'm an idiot. Too much on my hands. Now it's only returning one record. How do I echo the recordset to screen? I used to use

echo $query_rsEXPORT;

Sign in to reply to this post

Ray BorduinWebAssist

echo $RecordsetName->debugSQL();

Sign in to reply to this post

vernon webb

The recordset returned is right. Only it's return just the one record in the spreadsheet. Thoughts?

Sign in to reply to this post

Ray BorduinWebAssist

The number of rows is set in the WA_MySQLI_RS() function call as the second argument. If it currently has ,1 change it to ,0 and it will return all results.

Sign in to reply to this post

vernon webb

Originally Said By: Ray Borduin
  The number of rows is set in the WA_MySQLI_RS() function call as the second argument. If it currently has ,1 change it to ,0 and it will return all results.  



Thanks that worked. I have to remember that.

Sign in to reply to this post

vernon webb

BTW, the same results page above has to forms on it that update. The COMPLETE and CANCELED columns that are not updating. I'm thinking it has to do with the same issue as the other pages? I did download the files you said to my computer (I assume you mean in the WebAssist folder within the site).

Sign in to reply to this post

Ray BorduinWebAssist

How do I browse to the non-functioning pages? What are you supposed to click on to update the Complete or Cancelled value? I'll need more information to help understand what I'm looking at.

Sign in to reply to this post

vernon webb

The words themselves are buttons. Clicking INCOMPLETE will change it from INCOMPLETE to COMPLETE as well the CANCEL button.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...