CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Wondering Why This Isn't Working?

Print topic Send  topic

Author Message
ab5ni


Posts: 177
Posted: 07/29/2011, 9:54 AM

Hi guys,

Have this code in a BeforeShowRow code segment, and it's not working:

  
  
$db = new clsDBConnection1();  
  
 $SQL = "SELECT fullname, job_title, vendor_id FROM personnel";  
 $db->query($SQL);  
  
$db->close();  
  

As soon as the query is executed, the page won't display anymore. If I comment out the line, things work fine. One would think that I have somehow lost a connection to the db, but all my other pages work fine. Also, all the fields in the record are valid as are the field names themselves. Any suggestions here, and TIA as always :D.

Randy

_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!


View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 07/29/2011, 10:12 AM

ab5ni,

Have you tried running the query directly on the MySQL database?
View profile  Send private message
datadoit
Posted: 07/29/2011, 10:20 AM

When you're developing, make sure you have error reporting and/or
display errors turned on so that you don't see 'blank' pages.
tfertil

Posts: 43
Posted: 07/29/2011, 1:23 PM

Hi ab5ni

Since this code belongs to a BeforeShowRow segment, this could be executed more than once: one time for every row in your page. But I saw no filter in your query, so every row gets the same data.

Why don't get the data once?

Am I right?

Regards,
View profile  Send private message
ab5ni


Posts: 177
Posted: 07/29/2011, 3:28 PM

Quote mamboBROWN:
ab5ni,

Have you tried running the query directly on the MySQL database?

Yeah. I tried that, and even logged onto the server, checked the error-log file, and even ran the
query using the MySQL CLI command. Ran fine. (Shrug.)

Randy

_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!


View profile  Send private message
ab5ni


Posts: 177
Posted: 07/29/2011, 3:33 PM

Quote datadoit:
When you're developing, make sure you have error reporting and/or
display errors turned on so that you don't see 'blank' pages.

Okay. Sounds good, but which specific area should I look at to make sure this value is activated?

Randy

_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!


View profile  Send private message
ab5ni


Posts: 177
Posted: 07/29/2011, 3:40 PM

Quote tfertil:
Hi ab5ni

Since this code belongs to a BeforeShowRow segment, this could be executed more than once: one time for every row in your page. But I saw no filter in your query, so every row gets the same data.

Why don't get the data once?

Am I right?

Regards,

Well, actually, the code was stripped down to the simplest query I could make for debugging purposes. Maybe I made it too simple :D. I'll try adding a filter and see if it still doesn't work.

Randy

_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!


View profile  Send private message
datadoit
Posted: 07/30/2011, 5:48 AM

Turning on error reporting would be in your PHP settings. For WAMP or
XAMPP, display errors is turned on by default, as it should be and
should stay when developing.
ab5ni


Posts: 177
Posted: 07/30/2011, 10:09 AM

Quote datadoit:
Turning on error reporting would be in your PHP settings. For WAMP or
XAMPP, display errors is turned on by default, as it should be and
should stay when developing.

Well, I'm using a LAMP setup, so I'll mosey on over to my server and make sure it's set :D.
I used to use XAMMP under Windows, but I got tired of having to publish the project in 2
different places, over and over again.

Randy

_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!


View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 08/02/2011, 2:32 PM

ab5ni,

During your error checking did you determine how many records were being called by the query? Also, is there more to the code then what you have mentioned above? if so what is it? I'm asking because it may be helpful to see the query and all the surrounding code.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.