-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
Not when you have concurrent visitors performing database queries. Modern interrupt driven multitasking operating systems cannot guarantee the order in which queries are executed against your database server.
-
mysql_real_escape_string() requires a connection to the database server because it uses takes into account the current character set of your database.
-
If your data is escaped properly (only once) the actual slash \ character is NOT inserted into the database table and there is no need to remove slashes later.
-
You can only get the actual value of an auto-increment field after you have inserted a row. Insert the rows that make use of the value AFTER you execute the main query that establishes the auto-increment value. This method is need to prevent concurrent INSERTS from using an out of date value. If this method does not seem to work for what you are doing, then you need to re-think the way you are trying to accomplish this task.
-
Every image on a web page must use an <img ...> tag - http://w3schools.com/html/html_images.asp The URL that you put into the src="..." attribute must be a URL that outputs an image or for the case where you are dynamically outputting an image using php, the URL is that of the .php page that outputs the correct content-type header followed by the image data.
-
The error message does state what the problem is - one of your columns is defined as a primary key and you are trying to insert a duplicate value for that column. What do you want to happen when this condition (duplicate data values) occurs?
-
The From: address must be a valid email address at the sending mail server (or there must be an SPF record at the domain being used in the From: address that says that your mail server is authorized to send email for that domain.) Would you trust a letter you received from your credit card company with a From: address from within your country but a post mark saying it was mailed from a different country?
-
The mysql documentation contains a section on setting the time zone that is used by mysql - http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html Depending on your access level to the server, you can set it globally on the server or you can set it per-connection (requires that you execute a query like SET time_zone = timezone before you execute any queries that are time zone specific.)
-
A header redirect tells the browser to request the new URL. The rest of the code on the page is still executed unless you do something to prevent it, such as a die/exit statement or a conditional statement that is FALSE.
-
The technically correct separator between each header is an \r\n Just a \n might be causing problems either at the sending mail server or at the receiving mail server.
-
http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html
-
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format
-
difference between two datetime values from mysql
PFMaBiSmAd replied to galvin's topic in PHP Coding Help
You put mysql statements - You have an existing query that is SELECTing the data. You just add the TIMESTAMPDIFF() statement to the list of items being SELECTed. You would normally use an alias name for the result of that statement so that you can simply refer to the alias name as the index name when you fetch the data in your php code. -
Read the error message. The error message tells you where the output is occurring at that is preventing the session_start/header from working. You must find and fix whatever is causing that output and since you did not bother posting the whole error message or the code where the output is occurring at, no one here can directly help you fix the problem in your code.
-
difference between two datetime values from mysql
PFMaBiSmAd replied to galvin's topic in PHP Coding Help
Just use the mysql TIMESTAMPDIFF() function in your query with the unit parameter set to MINUTE - http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff -
could someone please help me with my php5.ini file
PFMaBiSmAd replied to Reaper0167's topic in PHP Coding Help
For debugging purposes, you need to set error_reporting = E_ALL and display_errors = ON (in the php5.ini would work) in order to get php to display the reason for the server error. -
php code works and dose not work - confused? take a look!
PFMaBiSmAd replied to gaogier's topic in HTML Help
You have a peppering of require_once() statements opening connections to your database server. Since there is not a valid connection at the point where the mysql_query() is being executed, then it is likely that your code before that point on the page is closing the connection as well. Either make a single connection at the beginning of your application and leave it open, or you will need to remove the _once() part of the require_once() statement in that code. Repeatedly opening and closing the database connection on one page will always take more time then opening it once. -
php code works and dose not work - confused? take a look!
PFMaBiSmAd replied to gaogier's topic in HTML Help
Those errors mean that at the time the query was executed there was no connection to the database server. -
php code works and dose not work - confused? take a look!
PFMaBiSmAd replied to gaogier's topic in HTML Help
If nothing you have changed in totals.inc has had an effect, I would suspect that you have more than one and the one you are changing is not the one that is being included and the one that is being included has an exit/die statement in it. -
php code works and dose not work - confused? take a look!
PFMaBiSmAd replied to gaogier's topic in HTML Help
I would temporarily comment out all the code in totals.inc, except for the opening/closing php tags and an echo 'you are here'; statement to see if the include() statement in the main code is even going what it is supposed to. -
php code works and dose not work - confused? take a look!
PFMaBiSmAd replied to gaogier's topic in HTML Help
I added an edit to my previous post above. Is the code being posted accurate? I would add the two debugging lines to the start of the totals.inc code (in case one of your other files is also setting the error_reporting/display_errors settings.) -
php code works and dose not work - confused? take a look!
PFMaBiSmAd replied to gaogier's topic in HTML Help
I think you miss the point of developing a web site and debugging code when it does not work. You don't throwaway code that you spent several man-hours developing that works the way your want it to just because it stops working when you move it to a different location. You find and fix the problem with your existing code, unless you are in the habit of throwing away your time and money. What did the error_reporting/display_errors code show? Edit to your edit: Are you sure you are not modifying the code you are posting here? Such as removing URL's being used in the include/require statements? -
php code works and dose not work - confused? take a look!
PFMaBiSmAd replied to gaogier's topic in HTML Help
I'm going to guess that you are getting a fatal runtime error because of the use of require_once() and the different mysql_connect.php and mysql_connect1.php files. For debugging purposes, add the following two lines of code on the line immediately after your first opening <?php tag in quest.php - ini_set("display_errors", "1"); error_reporting(E_ALL); -
Your current form at the link you posted submits the following data - If $_POST['date'] and $_POST['date2'] is what the form processing code is using, then the problem is somewhere in the form processing code. Are your sure the code on your live site is the same you are posting here? For example, the form fields were actually named from and to when I looked before making the 08:06:51 AM post, which is not what you posted in the 03:59:16 AM post in this thread.
-
php code works and dose not work - confused? take a look!
PFMaBiSmAd replied to gaogier's topic in HTML Help
Based on where the output stops, after the <br> right before the following - <?php include('totals.inc'); ?> Your problem is in the totals.inc code.