| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 579
![]() ![]() | Adding ifs and elses Here's one for ya. I have an SQL query which echos the results from he table into a table row (using the 'while' statement). Half way through, I have an include but the file included is just a set of ifs and elses which set a variable. But when I open the PHP file, it only shows the last result of the database query. It works perfectly when I remove the include though. Help would be very much appreciated and rewarded
__________________ SQL Dumpster - SQL Database Dumps and Resources |
| |
| | THREAD STARTER #3 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 579
![]() ![]() | Sorry, didn't really want to show off my bad coding, plus it's a bit long.. viewthread.php: PHP Code: PHP Code:
__________________ SQL Dumpster - SQL Database Dumps and Resources
Last edited by Encenta.com; 10-21-2005 at 11:09 AM.
|
| |
| | #4 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,074
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | not sure if it is causing the problem but I notice you are including config.php. Ussually people use this for creating theirdatabase connection plus other things. Are you also including this in viewthread.php if so it may be what is causing the problem. If are including this in both files there may be and probably is not any need as includes/statuses.php would already have access to the connection varaibles etc because it has full access to what the main script uses. When you include a file it acts as if the code is within the script it is included from. |
| |
| | THREAD STARTER #5 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 579
![]() ![]() | I've removed it from the included file (and updated my post) but still not working. Thanks for the suggestion.
__________________ SQL Dumpster - SQL Database Dumps and Resources |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |