473,660 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bypassing an Array

Chrisjc
375 Contributor
The question at hand is I bypass an array in column 4... but I also have something else that should be going in there from the database but because I am bypassing it and forcing it to show the ony think I want to show it will not show what is being generated from the database... and if I take the bypass out it works with no issues....

any ideas?

[PHP]
// -------------------------------------------------------------------------------
// Determine the highest number of $outArray entries for each colno, so we know
// how many table rows we have to generate
// -------------------------------------------------------------------------------
// 1. store the number of entries for each colno
$ent = array(count($ou tArray[$colArray[0]]),count($outArr ay[$colArray[1]]),count($outArr ay[$colArray[2]]),count($outArr ay[$colArray[3]]));
// 2. sort the entry counts in ascending order
sort($ent);
// 3. last entry must be highest, i.e. the number of table rows to build
$nr = $ent[3];
// --------------------------------------------------------------------------
// Start the output table and generate the header columns
// --------------------------------------------------------------------------
echo "<table border='0' style='border-collapse:collap se;'>";
echo "<tr>".
"</tr>";
// --------------------------------------------------------------------------
// loop through the $outArray array and construct the output HTML table
// --------------------------------------------------------------------------
for ($j=0; $j<$nr; $j++) {
// start a new row
echo '<tr>';
// there are four colno's, so we fill them from 0 to 3
for ($i=0; $i<4; $i++) {
// get the colno name (= key)
$col = $colArray[$i];
// here we have a new $outArray entry
// determine which vertical cell borders this one, depending on the colno ($i)
/* switch ($i) {
// left cell (column 1): right vertical borderline generation
case 0 : echo '<td style="padding: 0;margin:0;widt h:15px;backgrou nd: url(images/template_15.gif ) repeat-y;"></td>';
$cls='tdleft';
break;
// middle cells (columns 2,3): left and right vertical borderlines generation
case 1 :
case 2 : $cls='tdmid';
break;
// right cell (column 4): left vertical borderline generation
default: $cls='tdright';
break;
} */
// ---------------------------------------------------------------
// if this $outArray entry contains data: construct the <td> cell
// ---------------------------------------------------------------
if (is_array($outA rray[$col][$j])) {
// first save all $outArray entries in simple variables
$ais = $outArray[$col][$j]['aistpic']; // image name
$exp = $outArray[$col][$j]['exppartno']; // part number
$des = $outArray[$col][$j]['desc']; // explanation
$msr = $outArray[$col][$j]['msrp']; // price
$bun = $outArray[$col][$j]['buynow']; // this is the url or text

// *************** *************** *************** *************** **************
// START OF ACCESSORIES BYPASS
// fill the $outArray array with the accessories image and links
// *************** *************** *************** *************** **************
$outArray[4][0]['aistpic'] = 'images/aist/chemicals.jpg'; // image name
$outArray[4][0]['exppartno'] = ''; // part number
$outArray[4][0]['desc'] = '<a href="#" target="_blank" >Chemicals</a>'; // this is the url
$outArray[4][0]['msrp'] = ''; // price
$outArray[4][0]['buynow'] = '';
[/PHP]
Sep 24 '07 #1
4 2137
karlectomy
64 New Member
Hey,

Ok, I'm trying to break this down a bit.

You have product data in your db. Is it in one table?

Are you storing you mysql_fetch_arr ay() in $outarray? is the value in
$colarray[0] = 'aistpic' ?

I'm a little confused as to what you need to do with your bypass.
Sep 25 '07 #2
Chrisjc
375 Contributor
Hey,

Ok, I'm trying to break this down a bit.

You have product data in your db. Is it in one table?

Are you storing you mysql_fetch_arr ay() in $outarray? is the value in
$colarray[0] = 'aistpic' ?

I'm a little confused as to what you need to do with your bypass.

okay see let me try to break this down alittle better.

The bypassing arrary is working just fine... HOWEVER its working to good lol the issue is I am using arrays so everything called on gets pulled from the database then displayed via the arrary well I have 4 columns that display differnt things... I have a product that is possiable for ALL APLICATIONS there for I made the bypassing arrary so it will display a product in the 4th column no matter what is selected in the search.

The issue is ever sense I have done the bypass it will not show any products that are searched out in the 4th column only the bypassed one.

I know this link might be incorrect for the page but it is not for advertisment!

go to http://triplesource.net/cchilders/ph...Sytemstest.php This is the application.

Search out anything... notice only all 4 columns will have something... the 4th column that is displaying the Chemicals is what is being bypassed... however if you search out

DIESEL > GMC > Serria 2500 > 2007

There should be Chemicals AND Another part being displayed in the 4th column but because the bypass is there.. it will not display what is being pulled from the database... Does this make sense?
Sep 25 '07 #3
Chrisjc
375 Contributor
No one?


+++++++++++++++ MESSAGE GODS+++++++++++ +++++
Sep 26 '07 #4
Chrisjc
375 Contributor
Does anyone know anything on arrays????

Anything at all or am I not maken sense???
Oct 2 '07 #5

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

Similar topics

2
2779
by: Brian | last post by:
I'm diddlying with a script, and found some behavior I don't understand. Take this snippet: for ($i = 0; $i <= count($m); $i++) { array_shift($m); reset($m); }
2
575
by: Stormkid | last post by:
Hi Group I'm trying to figure out a way that I can take two (two dimensional) arrays and avShed and shed, and subtract the matching elements in shed from avShed I've pasted the arrays blow from a print_r cmd any suggestions would be great. Thanks much Todd //avShed array Array ( => Array ( => 1 => 08:00 ) => Array ( => 1 => 08:05 ) => Array ( => 1 => 08:10 ) => Array ( => 1 => 08:15 ) => Array ( => 1 => 08:20 ) => Array...
2
11158
by: Jens Kalkbrenner | last post by:
MS SQL-Server 7.0 Bypassing recovery for database 'EfW_765' because it is marked IN LOAD. What does this mean? Our customer is backing up is maindatabase and is recovering it to this database for testing. Our custumer tries it serveral times and then the recovery works and the data are corrupt. I have written a little programm which does some selects to this database. The program is stopped during recovery but our customer beleves that...
3
1364
by: Eric St-Onge | last post by:
Hi, I have a DLL that exposes COM interfaces. One of the COM Object receives an IDispatch pointer. I know that this IDispatch pointer is in fact a COM Callable Wrapper for a System::Drawing::Bitmap object. How can I get a reference to the .NET Bitmap, bypassing the CCW? ex:
8
3459
by: ashoksrini | last post by:
Hi All, I have the below requirement and would like to get some feeback from the group on the best way to implement: 1. I have WSDL defined exposing few web services. 2. We dont have a requirement to have a server web service class. (reasons below) 3. I want to develop something like this - when client makes a web service call, on the server I can intercept the SOAP message (XML doc itself),
4
1889
by: antonyliu2002 | last post by:
Let me try to make clear what my concern is. I think it is a pretty interesting one, which I think of while I am developing my web application. I have an authenticated/authorized web application. People have to login from http://mydomain.com/ to access the information on my site. For now, this is working fine. People cannot bypass the login form, any attempt to check out a page (if they happen to know the file name) will be...
0
2965
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the report directly to the printer bypassing the Crystal report viewer altogether. When sending the job directly to the printer I use the PrintToPrinter command CR.PrintToPrinter(1, False, 0, 0)
1
1891
by: =?Utf-8?B?QXVzdGluIFN0ZXBoZW5z?= | last post by:
In my commercial financial application I run a deposit report. I use an option to copy the report to the Clipboard. I then run a .NET consol app to “grab” the Clipboard and format the data and print laser deposit tickets. I use the following to set my printer: PrintDocument doc = new PrintDocument(); if (printer != "default") doc.PrinterSettings.PrinterName = printer; I then raise an event: doc.PrintPage += new...
10
5519
by: Tim Streater | last post by:
I have a form and a button to submit it. The button is made from: <input type=button onclick='myHandler(this.form);'> This all works fine except that in Safari 2.0.4, the enter/return keys, if pressed, submit the form - bypassing my onclick handler. I can partially fix this with: <form onsubmit='return false;'>
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8539
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.