-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
By storing the data in an intermediate array and looping over that array, when you are just going to output all the results anyway, you are causing that portion of the code to use twice as much memory (the data is already stored in memory in the result set) and you are causing that portion of the code to take twice as long to execute. <?php $Query01 = "SELECT * FROM `CustomerSignups` WHERE `Id` = '$_GET[id]'"; $Result01 = mysql_query($Query01) or die("Error 01: " . mysql_error()); while ($get_info = mysql_fetch_assoc($Result01)) { foreach ($get_info AS $key=>$value) { echo "{$key} - {$value}<br/>"; } } ?>
-
mysql_num_rows() expects parameter 1 to be resource, boolean given
PFMaBiSmAd replied to chicago's topic in PHP Coding Help
You can find out why the query is failing by adding some error checking and error reporting logic to the code - $result=mysql_query($sql) or die(mysql_error()); -
You can do an UPDATE that simply adds one to the current value, but you asked which method is better. Recording each view as a separate row using an INSERT query IS better.
-
How to output BLOB images through PHP to HTML ?
PFMaBiSmAd replied to anevins's topic in PHP Coding Help
Is that when you are using a URL like showblob.php?id=x and are you doing any URL rewriting that might not be passing the ?id=x on the end of the actual URL? -
At the end of my rope - please help me: On air now script
PFMaBiSmAd replied to danianheron's topic in Third Party Scripts
Php is a server-side scripting language. It gets added to a web server so that .php code will be parsed and interpreted on the server when .php pages are requested by the browser. DW has never been very server-side friendly. You either need to install a web server with php on your local development computer (there are all-in-one packages, such as http://www.apachefriends.org/en/xampp.html ) or test your code on your 'live' web server. -
Requiring includes to come from server side
PFMaBiSmAd replied to hybridpunk's topic in PHP Coding Help
Where in your code are you setting the $page variable at, from the $_GET['page'] value? -
I'm using the latest Firefox 3.6.15 under Windows XP and yes I went to the http://projectstratos.com/forum link you posted above, which redirects to http://www.projectstratos.com/forum/
-
From my post in reply #14 in this thread (~ 1 hour ago), up until right before I typed this reply, I have remained logged in as the 'test' user and have even closed my browser completely, twice, and have taken the time to navigate to some of the admin pages. You are going to need to investigate what is happening with the session id in your browser and I both recommend that you make an account separate from the 'test' one to do so because someone else being logged in as that user might be kicking you off and that you change the test user (or at least change the password) so that it is not an administrator to the script so that all the people that have read this thread don't take over your site.
-
The 'test' user stays logged in for me (on the phpbb pages and in going to your main page and back to the forum), however, it appears that php is configured on your system to put the session id on the end of the URL, while phpbb is using a session id cookie. I'm going to guess if you are having a problem staying logged in that either you are switching back and forth between URL's that have and don't have the www. on them or your browser is not configured to accept cookies or you have a corrupted or invalid cookie from some previous testing and should delete it/them and try again.
-
And the current problem is???
-
Wouldn't it be a good idea to continue making progress in an existing thread, rather than throw away the information gained in that thread? It's also against the forum rules to start duplicate threads for the same issue and just because the error message changed, what you are trying to do didn't change.
-
See the "You should eat fruits, vegetables, and fiber every day." example at this link - http://us.php.net/str_replace
-
The 3rd parameter would need to be your $action1 variable and the first two parameters would need to be arrays with matching entries for all 21 pairs of values/words.
-
^^^ No, you can't. Did you try logging in as the test user?
-
You already have an active thread from yesterday with this query. Some reason you didn't continue this in that thread and continue executing the query so that you are getting the msyql errors from it? gristoi posted a more correct query in that thread that you didn't use, because he removed a lot, but not all of the single-quotes you have around the table, column, and alias names.
-
What's the actual syntax that you used to change the upload_max_filesize setting, where exactly did you try to set it at, did you use a phpinfo() statement to verify that it was actually changed, and what does the phpinfo() statement show for the post_max_size setting?
-
Un-escaped data?
-
How about using mysqli_error($dbc) to get php/mysql to tell you why the query is failing?
-
The d's need to be escaped so that they mean decimal digits rather than the letter d - $xmls_pattern = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}:\d{2}:\d{2}-\d{2}:\d{2})/";
-
Problems adding multiple upload fields to upload script
PFMaBiSmAd replied to perky416's topic in PHP Coding Help
Your code that is checking the extension is validating information about the uploaded file(s). You cannot (successfully) do that until you know the file has been uploaded without error (there are a few of the possible upload errors that will populate the uploaded file name, but there is no uploaded file.) In order for you to iterate over the array of uploaded files, you must use array functions to do that. The link I posted above does what you need. Your php code won't work until you change it to iterate over the array it receives, which is why you were getting your "Incorrect format!...." error message. Removing the logic that was producing that error message, didn't fix anything, it just removed code that was pointing out where a problem was occurring at. -
Problems adding multiple upload fields to upload script
PFMaBiSmAd replied to perky416's topic in PHP Coding Help
Your code has absolutely NO error checking logic in it to test if the upload worked before blindly attempting to use any of the uploaded file information. See Example #3 at this link - http://us.php.net/manual/en/features.file-upload.post-method.php for some php code that will loop though the uploaded files and ONLY process them if they were successfully uploaded (no upload errors.) -
Line 1 of header.in is HTML (specifically the HTML doctype) that is sent to the browser. You must put the session_start() statement before any characters are sent to the browser.
-
Since the session_start() statement is on line 3 in header.inc, what are lines 1 and 2 of header.inc?
-
Passing $string variable into mysql query
PFMaBiSmAd replied to spangle1187's topic in PHP Coding Help
One = in the query as well. -
It's unlikely the error is exactly the same, because the suggestion would have fixed the error you were getting at that point in the query. If you are getting the same type of error, but at a different point in the query, wouldn't it make sense to try using the same solution that you were just given?