-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
Search with multiple criterion in MySQL database
PFMaBiSmAd replied to hybmg57's topic in MySQL Help
Don't put single-quotes around column names. That makes them strings, not column names. -
html email from localhost or local machine
PFMaBiSmAd replied to jkkenzie's topic in PHP Coding Help
Are you expecting to send emails to yourself at your email address at an ISP or are you expecting to send emails to any arbitrary email address? To send emails to yourself at your email address at an ISP, you can use one of the phpmailer classes that support SMTP Authentication. You authenticate against your email account (provide your email username and password) and you can send emails to your email address and you can also send emails through your email account to other email addresses. To send emails to any arbitrary email address, you must set up a PUBLIC mail server. A public mail server has a domain name associated with it, a public DNS server that points to it, and all the necessary DNS zone records that would allow other email servers to authenticate it is a valid public mail server so that they would accept emails sent by it. -
Do you know for a fact that the php mysql extension is loaded on your server? Are you doing this on a server with error_reporting set to E_ALL and display_errors set to ON so that all the php errors would be reported and displayed?
-
In the code that sets $img = "..." . $table . "...";, $table does not have a value. Pretty simple, yes? If you want someone in a forum to help you determine why that would be so, you must post your actual code (not just a couple of lines taken out of context.) Telling us about what your code is supposed to do is pointless, because obviously it is not doing what you are stating.
-
Image Uploading problem, Working On Localhost But not on SERVER
PFMaBiSmAd replied to darubillah's topic in PHP Coding Help
Your upload form does not have a field that sets $_POST['file'], so what was the if (!empty($_POST["file"])) { originally when the code worked on your development system? I'll guess it was $_FILES['file']? -
why can't insert data into the database table?
PFMaBiSmAd replied to runeveryday's topic in PHP Coding Help
echo mysql_error(); on the next line after your mysql_query() statement to find out if the query is failing and why. -
Image Uploading problem, Working On Localhost But not on SERVER
PFMaBiSmAd replied to darubillah's topic in PHP Coding Help
SLOW DOWN (everyone). Your whole php code is being skipped over because $_POST['file'] does not exist. If your code worked on your development system (which I doubt at this point), but not now, something is preventing that post variable from being set. Start by posting all your code, including the form. -
Image Uploading problem, Working On Localhost But not on SERVER
PFMaBiSmAd replied to darubillah's topic in PHP Coding Help
Either your form is doing something that is php version/configuration specific and is invalid (unlikely) or the total size of the form data exceeds the post_max_size setting (fairly likely). What does a phpinfo(); statement show for post_max_size setting and what size of a file did you attempt to upload? -
Simply amazing, another "my code does not work but I'm not going to provide you with any real information about what my code is that would allow you to help me." Best guess is you are outputting content to the browser before your redirect and/or you don't really have error_reporting set to E_ALL and log_errors turned on so that ALL php errors would be logged.
-
Image Uploading problem, Working On Localhost But not on SERVER
PFMaBiSmAd replied to darubillah's topic in PHP Coding Help
For debugging purposes (remove them when you are done), to see if there are any php detected errors, add the following two lines of code immediately after your first opening <?php tag - ini_set("display_errors", "1"); error_reporting(E_ALL); -
User being logged in regardless of password!?!?
PFMaBiSmAd replied to wee493's topic in PHP Coding Help
What exact symptom are you getting that makes you think the user is logged in? Also, what is your code that is testing $_SESSION['user'] to determine if someone is logged in? -
How to sort data from a table in alphabetical order?
PFMaBiSmAd replied to angel1987's topic in MySQL Help
Your data probably contains white-space/non-printing characters (spaces, carriage-returns, nulls, line-feeds, ...) that is causing it be sorted out of order. Where did your data originate and how did it get inserted into your table? There are literally millions of php based web sites that use ORDER BY in queries that work. Had you stated or shown what results you are getting in your first post in this thread (where it belonged), you could have gotten an answer quicker, rather than playing around with what problem you actually are having. -
You are using php5 syntax on a php4 system. It is time to upgrade your php version. The end of life and end of support of php4 was over 2-1/2 years ago.
-
How to sort data from a table in alphabetical order?
PFMaBiSmAd replied to angel1987's topic in MySQL Help
And that gave you output in DESCending alphabetical order didn't it? -
How to sort data from a table in alphabetical order?
PFMaBiSmAd replied to angel1987's topic in MySQL Help
Since you did not show the query you tried using ORDER BY and the output you did get, it is a little hard for anyone one here to tell you why it did not work. -
Did you read the error message, it is fairly self explanatory - The function display_forums() is being redeclared in the same place it was previously declared. The only way that can happen is if you are including functions_display.php more than once. Since you did not provide the name/author's site for the modification or if the /boards/includes/ path on your site is specific to the modification or something else you were already doing, it is not directly possible to provide more specific help.
-
You are accessing the file using a URL and that is probably disabled. The error you didn't post (in your unedited post) and the abbreviated contents of the downloaded file are probably errors alerting you to this fact. If the file is actually local to the server, you should be using a file system path to access the file in the readfile() statement. By using a URL, you are causing your server to make a http request back to itself, to read the file, then output it. That consumes three times the bandwidth than just reading the file through the file system and outputting it. Edit: If you open the abbreviated downloaded file using your programming editor, what does it contain?
-
I need something like IN(1,2,3) but more like IN(1 AND 2 AND 3)??
PFMaBiSmAd replied to ultrus's topic in MySQL Help
Assuming you don't have duplicates (i.e. sys2, asteroids, sys2, asteroids), this should (untested) work - SELECT name, count(*) as cnt FROM system_contents WHERE contains IN('asteroids','planets') GROUP BY name HAVING cnt = 2 -
There's nothing wrong with your query or code and it works as expected (just tested) provided you have data in the Editor_Candidates table so that the user_id matches up rows between the Responses and Editor_Candidates table.
-
The value from a mysql_query() will only be FALSE if the query fails due to an error (i.e. no connection to the database server, no database selected, a syntax error in the sql, a duplicate key...) A query that executes without any errors but matches zero rows is a successful query and returns a result resource, but the result set contains zero rows in it. You can use mysql_num_rows() to find out how many rows are in the result set.
-
file_get_contents doesn't seem to get the file contents (help!)
PFMaBiSmAd replied to Chezshire's topic in PHP Coding Help
Did you try that to see if it worked or not? One of the points of programming is you can try ideas and immediately observe the results to learn if your idea was correct or not. You don't need to wait around in a programming forum to learn answers to basic questions like that. -
$row["login_timestamp"] is either empty or not defined. Have you checked by echoing it (or use var_dump()) to see what exactly it is?
-
In mysql, if you execute an UPDATE query and none of the values are actually different, the actual UPDATE is not performed and the table is not changed. There is no guarantee that any other database exhibits that same behavior. You would need to check the values yourself in your code to determine if the submitted values are the same as the existing values.
-
file_get_contents doesn't seem to get the file contents (help!)
PFMaBiSmAd replied to Chezshire's topic in PHP Coding Help
You are missing quotes around the file name, making php think it is a defined constant (if error reporting was set to E_ALL you would see some notice messages alerting you to this problem.) Edit: Specifically -