473,505 Members | 15,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bizarre Partial Source Code Output without Echo

72 New Member
I've gotten a really weird result crop up on my site, and I can't find any information on the web that it has been seen elsewhere. Given how weird this is, I guess it's probably a symptom of either a server-side setting, or something very subtle.

I have some code that builds a MySQL statement to retrieve some records. The subsequent HTML displays the results. No problem.

I then changed the statement to have a WHERE clause that reads:

"WHERE DATEDIFF(NOW(), POSTDATE) <= 2"

Suddenly, I'm getting fragments of the php code behind the site turning up as output to the web page. There are no echo statements in this code at the points where the code is turning up, always as partial lines of the whole.

If I take the where clause back out, the code fragments do not appear.

At first I thought maybe my syntax was incorrect, that I had not closed off a line or php section, but its all the same as when the statement is not there. And the code does turn up from sections not in the same part as the SQL statement too.

I then tried putting in a number of echo statements to output at what stage in the code it had gotten too, along with an 'echo mysql_error()' statement to see if there was a problem with the SQL.

None of the echo statements got output, and the code fragments became larger portions of the code, which included the newly added echo statements right in the middle of them! So it's like this error is overriding what the echo command says, and even outputting content before, after, and during the line for the echo.

This is when the WHERE clause is in the statement. If I take the WHERE clause out, but leave the echo lines in, the problem continues to occur. It's only if I take both the echo statements and the WHERE clause out that it stops doing this.

This strikes me as very odd, and I wondered if anybody knows what might be causing this?
Mar 30 '07 #1
2 1850
code green
1,726 Recognized Expert Top Contributor
What could be happening is your browser is treating the '<' in your query as an opening HTML tag.
Expand|Select|Wrap|Line Numbers
  1. (NOW(), POSTDATE) <= 2"
Have a look at the HTML source code of the output for a better clue.
Mar 30 '07 #2
Motoma
3,237 Recognized Expert Specialist
Perhaps you could post the relevant area of code (5 lines on either side of your problem) in [CODE ][/code] brackets.
Mar 30 '07 #3

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

Similar topics

0
1538
by: Ethan | last post by:
I've been having some really weird problems with a very simple PHP app. I'm wondering if anyone can help me sort this out. I have a page that prints out the results of a MySQL query as an HTML...
5
2344
by: Simon Pryor | last post by:
I am having some strange problems using std::ostringstream. The simple stuff works okay, but trying to use: std::ostringstream::str(const std::string&) or:...
1
2867
by: Alex Sedow | last post by:
Where to get/buy tool for partial preprocessing? 1. What I mean by partial macro preprocessing. This is mode in which almost sources (>99%) is not preprocessed. But some macros (setted by...
16
2627
by: pawel.pabich | last post by:
Hajo, I would like to have 2 my own partial classes. For example: Default.aspx.cs Default2.aspx.cs and they both will relate to Default.aspx page.
1
2620
by: Bishoy George | last post by:
In a web application using asp.net 2.0 All my classes are partial classes. - I noticed that partial class cannot be inherited... is that true? - I tried to remove the partial keyword , and I...
5
5629
by: voronwae | last post by:
Hi folks. Either I'm missing something really obvious (most likely) or I'm missing something really subtle. I've been building up a machine as an IMP webmail server, with php 5.1.2, cyrus-sasl,...
4
3676
by: ImOk | last post by:
I come from the Visual Foxpro world, which is one reason I love PHP. VFP is a scripting type language with macro substitution abilities similar to PHP. Besides the regular expansion I can do...
9
5768
by: Fat Elvis | last post by:
I'd like to extend some of my Asp.net pages by using Partial Classes. Example ASP.Net Page: public partial class Admin_Customer : System.Web.UI.Page { protected void Page_Load(object sender,...
26
25565
by: webrod | last post by:
Hi, I have some php pages with a lot of HTML code. I am looking for a HTML validator tool (like TIDY). TIDY is not good enough with PHP tags (it removes a lot of php code). Do you have any...
0
7216
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7018
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...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5613
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 project—planning, coding, testing,...
0
3187
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...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1528
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 ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
407
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...

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.