473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

not writing to array correctly

32
please excuse the $sqlHelper syntax.. it is part of the framework to run the queries
[php]
if($sqlHelper->execute())
{
while( $sqlHelper->db->moveNext() )
{
if( $sqlHelper->db->record['fe_only'] == 1 && !file_exists("/images/parts/". strtolower($sqlHelper->db->record['number']) .".jpg") )
{
$hardwareArray[] = array(
'HRDWR_ID' => $sqlHelper->db->record['part_id'],
'HRDWR_NUM' => $sqlHelper->db->record['number'],
'HRDWR_DESC' => str_replace("\n", "<br />", $sqlHelper->db->record['description']),
'HRDWR_NOTES' => $sqlHelper->db->record['notes'],
'HRDWR_QTY' => $sqlHelper->db->record['quantity'],
'HRDWR_UNIT' => $sqlHelper->db->record['unit']
);
}
else
{
$childArray[] = array(
'SUB_ID' => $sqlHelper->db->record['part_id'],
'SUB_NUM' => $sqlHelper->db->record['number'],
'SUB_DESC' => str_replace("\n", "<br />", $sqlHelper->db->record['description']),
'SUB_NOTES' => $sqlHelper->db->record['notes'],
'SUB_QTY' => $sqlHelper->db->record['quantity'],
'SUB_UNIT' => $sqlHelper->db->record['unit'],
'SUB_IMAGE' => strtolower($sqlHelper->db->record['number']),
);
}
}
}
[/php]

this is running the query fine, and it will put all of the sub parts in the array which prints out correctly. my problem is that it doesn't do the separation correctly. The moveNext() is supposed to just get the next row from the database and check once again which array it should be transplanted into, but doesnt... can anyone see where im going wrong?
Aug 27 '07 #1
2 1097
pbmods
5,821 Expert 4TB
Heya, Jgentes.

What is moveNext() doing?
Aug 28 '07 #2
Atli
5,058 Expert 4TB
Hi.

I see no real problem with this code. If the second IF statement is doing what it is supposed to be doing then it would be safe to assume that your problem, which I don't really understand btw, is somewhere inside your sqlHelper class.
Aug 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Paul C-T | last post by:
Hi, Am I trying to be too clever here? I am trying to write a PHP page to enable me to enter values into a form then write those values to a text file. I want to use the form & table that...
4
by: Nhwk | last post by:
I have an unsigned char banner, which contains data for a 12x8 bitmap file. I am attempting to construct and write to disk a .bmp file with this data. So far, I started by constructing the...
6
by: Oleg Kornilov | last post by:
Hello ! Who can explain why readind from array is fast, but writing (same place) might take a lot of time (I need many loops) How to solve it (declare as static or force some compiler (VC 6.0)...
1
by: worldbadger | last post by:
Hello, The following code does not execute properly. It only writes the first array, and it does it all 23 times(the number of times it is suppose to). All arrays are set (Dim studid(25)),...
9
by: mupe | last post by:
Hi, i have a problem with a Type Library, which is written in C++. I am developing an application in C#.NET and have to use functions from this COM-Type Library. When I use these functions in...
8
by: SP | last post by:
The following code crashes after I add the two nested FOR loops at the end, I am starting to learn about pointers and would like to understand what I'm doing wrong. I think the problem is the way...
19
by: rmr531 | last post by:
First of all I am very new to c++ so please bear with me. I am trying to create a program that keeps an inventory of items. I am trying to use a struct to store a product name, purchase price,...
2
by: Clive Green | last post by:
Hello peeps, I am using PHP 5.2.2 together with MP3_Id (a PEAR module for reading and writing MP3 tags). I have been using PHP on the command line (Mac OS X Unix shell, to be precise), and am...
19
by: Gerry Ford | last post by:
I've been pecking away at writing a program that will calculate the inner product of two double-width four-vectors. Larry thinks I'm well started with the following source to populate a vector:...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.