-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
SELECT SUM and WHERE / Sum of rows for multiple tables in 1 query.
PFMaBiSmAd replied to u214's topic in MySQL Help
Since you haven't shown any information about these multiple tables, it's not possible to provide a direct answer. If the tables are related, when you write a query using JOINs, you can sum information the same as if you were querying one table. -
mysql driver is not currently installed
PFMaBiSmAd replied to OAFC_Rob's topic in PHP Installation and Configuration
That's an indication that you installed php using the .msi installer or via one of the all in one packages and you must enable extensions either through the windows control panel add/remove or the all in one control panel. How did you obtain and install php? The .msi installer, the .zip package and manually install it, or one of the wamp all in one packages? -
SELECT SUM and WHERE / Sum of rows for multiple tables in 1 query.
PFMaBiSmAd replied to u214's topic in MySQL Help
The error in your current query is because the FROM table_name is not in the correct location. -
You query for the data you want, then you store all the records/row-arrays in a php array using the datetime of the appointment as the array index/key (so that you can find the correct record easily later.) As you are looping to produce the output for each time slot, you form a datatime value of that time slot and use that value to test for/retrieve the record/row for that time slot from the php array you created.
-
This topic has been moved to PHP Coding Help. http://forums.phpfreaks.com/index.php?topic=364927.0
-
Select all options from a select box with MySQL
PFMaBiSmAd replied to CristiM's topic in PHP Coding Help
The first reply stated how you would do this (in your php code.) Since this isn't a query problem (yet), moving thread to the php help forum... -
Your code is making a database connection after trying to execute a mysql_query() statement. You need to have php's error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will help you by reporting and displaying all the errors it detects. You will save a TON of time. Stop and start your web server to get any changes made to the master php.ini to take effect and check using a phpinfo statement that the two settings actually got changed in case the php.ini that php is using is not the one that you changed.
-
Yes. The ['error'] element of $_FILES array will be a 1 (UPLOAD_ERR_INI_SIZE) value. See this link - http://us2.php.net/manual/en/features.file-upload.errors.php
-
The email is not being sent FROM the name/email you have in $_SESSION['name'] and $_SESSION['email']. It is being sent FROM your mail server to a hotmail mail server. The domain name you put in the email address in the FROM header must match the domain at the sending mail server or you must have an SPF DNS record at the domain being put into the FROM address that indicates the sending mail server is authorized to send email for that domain. Also, read the following - http://mail.live.com/mail/troubleshooting.aspx
-
^^^^ Speaking of which, the dump of the file_type field shows a huge number of non-printing/white-space characters that need to be trimmed.
-
To prevent a page refresh from repeating the last action, you will need to redirect to the same page with the ?action=xxxxxx get parameter removed from the URL.
-
You are gong to need to get JUST the file name part (without the extension) and use a natural sort on it.
-
I guess (just tested) that the ; don't matter right before the ?> tag.
-
Your code is missing two endif; keywords and you also have one in your code that is missing the ;. Since there's no way we could possibly know where those missing endif; were intended to be, you would need to go through the code and make sure that every if/else/endif is where it should be. Unfortunately, the WP style of coding doesn't lend itself to troubleshooting simple syntax problems. You have more characters taken up by the excessive opening and closing php tags and the alternative php closing keywords than the amount of html in the file. It's a mess of excessive syntax that makes it harder to see what the actual code and html is.
-
Then what current problem are you having, i.e. we only see the information that you supply in your posts.
-
You need to find and fix the problem with the data that is stored in your database table. That will require you to trim the offending leading characters in the data that is stored in your database table. The suggestion that The Little Guy posted has nothing to do with fixing your problem. P.S. The sample print_r that you posted doesn't show any of the problem data.
-
Fatal error: Call to a member function bind_param() on a non-object
PFMaBiSmAd replied to Hacym's topic in PHP Coding Help
The syntax of your UPDATE query is not correct. The following is the syntax definition for an update query with required and most commonly used parts in red - UPDATE [LOW_PRIORITY] [iGNORE] table_reference SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ... [WHERE where_condition] [ORDER BY ...] [LIMIT row_count] -
The header() redirect is inside of some post mode form processing code. There's no guarantee that at the time the form has been submitted that $_GET['id'], that is used in the select query, has a value. Your code has NO validation/casting/escaping of external data to insure that any of that data even has a value, and a safe one, before attempting to use it. If all the code you have been posting requires there to be a $_GET['id']/asset value, then all that code should be inside of a conditional statement that has checked that there is an expected $_GET['id'] value. edit: P.S. Your log in check code is not secure. You need an exit; statement after the header() redirect to prevent the remainder of the 'protected' code from running. All a hacker needs to do is ignore the header redirect and he can access that page the same as if he was logged in.
-
PHP Headers (Some way to redirect them?)
PFMaBiSmAd replied to thomasw_lrd's topic in PHP Coding Help
You can only output one content-type per http request. For the http request for your web page, you cannot switch in the middle and try to download a vcard. You must put a link to the vcard that you want to be downloaded. If that vcard is dynamically created, the link would be to the .php script that creates the vcard. The .php script would retrieve the data from your database, output the correct content-type header, followed by the dynamically produced vcard data. The one thing that you could do to your current code that would allow the vcard download to work, would prevent the web page up to that point from being output, so it would be kind of pointless. -
Because you are doing this en-mass, I would first retrieve all the team names/ids and store them in a $lookup array, where the index is the team name (converted all to lower-case and with any white-space removed), and the value is the id. At the point of needing the team id, you would simply get the lower-case/all white-space removed team name from the supplied data and use that value as the key to access the correct element in the $lookup array.
-
Sorting what array? The code you posted doesn't contain any php array or any php code attempting to operate on that data. Without the code that produces the incorrect result, sample or actual input data, the incorrect output from that data, and the expected output from that data, its not possible to help with coding problems.
-
If after ignoring the spaces, all the filenames are the same length, so that they could be sorted as strings, then you could do this in the query by sorting on a copy of the values with the spaces removed. Otherwise, you would need to use natcasesort in php. Edit: post an example of the incorrect output you are getting, because it's likely you have some leading white-space in with the data that is causing this.
-
Undefined function ctype_digit
PFMaBiSmAd replied to Mahngiel's topic in PHP Installation and Configuration
Are you sure about the code/exact error message? Perhaps you have a typo in the function name. -
For us to be able to help you with any programming problem you are having, you must supply the all the relevant code and sample data needed to reproduce the problem. There's at least 6 different things I can think of that could cause the symptom.
-
Exactly where are they still appearing at?