Search found 56 matches
- Fri Nov 02, 2018 1:18 am
- Forum: PHP - Code
- Topic: Getting started
- Replies: 2
- Views: 61718
Re: Getting started
You may also checkout PHP & Mysql for Dummies. Those are pretty good starting points as well.
- Sun Mar 09, 2014 7:50 pm
- Forum: PHP - Code
- Topic: Help needed
- Replies: 10
- Views: 3183
Re: Help needed
It is complaining that Connections\PhoenixDB.php doesn't exist. If it does exist it isn't being found. Is your web server Windows? If not you're using the wrong slash. Unix-like server use / to separate folder names. You could also be more specific as to the files location: \directory\another\Connec...
- Sun Jul 22, 2012 4:20 pm
- Forum: Databases
- Topic: php and mysql
- Replies: 1
- Views: 1941
Re: php and mysql
This line make no sense:
You don't have such a variable. Instead you should use $user.
Try print_r($user) and you'll see the resulting array from mysql_fetch_array.
Code: Select all
echo $ingreso['correo'], '<br />';
Try print_r($user) and you'll see the resulting array from mysql_fetch_array.
- Fri Jan 06, 2012 9:05 pm
- Forum: PHP - Code
- Topic: Leaderboard problem
- Replies: 4
- Views: 935
Re: Leaderboard problem
As a rule I avoid using variables to store data which is related to other data or has more than one value. This is something you want to avoid: $firstname1 = "John"; $firstname2 = "Steve"; That will be very difficult to work with. Instead if you store your data in an array (or ob...
- Sat Oct 15, 2011 1:22 am
- Forum: PHP - Code
- Topic: Now should i cache very rows from mysql?
- Replies: 2
- Views: 880
Re: Now should i cache very rows from mysql?
I'm not sure I understand your question. Here is how I'd do this: When user logs in check $_SESSION for stats. If unset, query the table for stats. Save the stats into $_SESSION as an array. If the stats change, update the database and update the $_SESSION array. With this method you only need to SE...
- Sat Jul 16, 2011 3:47 pm
- Forum: PHP - Code
- Topic: APC page caching in the presence of a dynamic "require"
- Replies: 1
- Views: 243
Re: APC page caching in the presence of a dynamic "require"
As far as I understand it you'd wind up with a cached version of php files as they are used. In other words the functions.php file would be cached right off the bat. The files that are required will be cached as they are actually used. When the files change, or you run out of cache memory older file...
- Sun Jul 10, 2011 1:08 pm
- Forum: PHP - Code
- Topic: IMG SRC PHP -> PNG
- Replies: 4
- Views: 443
Re: IMG SRC PHP -> PNG
Yes though you'd need to tell the web server than captcha.png is actually a PHP file and should be processed as such. If you're using Apache you can do this with a .htaccess file something like: <FilesMatch "^captcha.png$"> ForceType application/x-httpd-php AcceptPathInfo On </FilesMatch>
- Wed May 25, 2011 1:31 pm
- Forum: PHP - Code
- Topic: Date saving problem
- Replies: 2
- Views: 274
Re: Date saving problem
Here is how I'd approach this: I like to store dates in MySQL as "datetime" then convert to whatever I want. In your case I'd: Convert the time the user submitted: $timestamp=strtotime($_POST["time"]); // $timestamp is now a timestamp of 5pm $saveme=date("G:i", $timesta...
- Sat Apr 16, 2011 8:23 pm
- Forum: PHP - Code
- Topic: downloading zip using php
- Replies: 5
- Views: 1093
Re: downloading zip using php
Actually you got it right. You want to print the header information before readfile outputs the zip. $file_output is a bad name though. It's really $header_output. The file will be outputted using readfile(). readfile() will open and print the file all at once. As for security you're alright so far....
- Wed Apr 13, 2011 11:28 am
- Forum: PHP - Code
- Topic: downloading zip using php
- Replies: 5
- Views: 1093
Re: downloading zip using php
No problem here is a quick demo: // Capture output from here on down... ob_start(); print "This won't actually be displayed until latter."; // Save the buffered output into a variable. $my_output=ob_get_contents(); // Stop buffering and clear the results from memory ob_end_clean(); // Now ...
- Mon Apr 11, 2011 9:28 pm
- Forum: PHP - Code
- Topic: downloading zip using php
- Replies: 5
- Views: 1093
Re: downloading zip using php
Well your ob_start and ob_end_clean are preventing the headers from being sent. You're buffering them but not outputting the buffer.
You'd need a ob_get_contents(); and an echo or print.
You'd need a ob_get_contents(); and an echo or print.
- Fri Apr 08, 2011 7:12 pm
- Forum: PHP - Code
- Topic: Creating facebook style messages
- Replies: 1
- Views: 188
Re: Creating facebook style messages
So far it sounds right to me. I guess you'll want to group data for each message by it's ID.
You could either do this logic for this in PHP or perhaps two queries. One to get the messages, and other to get the TO and FROM data.
You could either do this logic for this in PHP or perhaps two queries. One to get the messages, and other to get the TO and FROM data.
- Wed Apr 06, 2011 7:44 pm
- Forum: PHP - Code
- Topic: Best way to filter mySQL data *after* querying?
- Replies: 1
- Views: 396
Re: Best way to filter mySQL data *after* querying?
I prefer to fetch results and save the data into an array. I then use the array latter to output. // Save results into an array $people = mysql_fetch_array($result_set); // now output foreach($people as $person) { if($person['filtering_category''] == 1 ) { print $person["First_Name"]; prin...
- Mon Apr 04, 2011 6:32 pm
- Forum: PHP - Code
- Topic: Sessions not working... I think
- Replies: 13
- Views: 1653
Re: unexpected $end error
The problem is probably with your $member array. I suspect your array is actually: $member[0]["username"] not $member["username"] You can verify this by adding in: print "<pre>"; print_r($member); print "</pre>"; // or print "<pre>"; print_r($_SESSIO...
- Fri Mar 18, 2011 4:01 am
- Forum: PHP - Code
- Topic: Refresh issues
- Replies: 5
- Views: 385
Re: Refresh issues
Sounds like one of two issues: #1 what welry said. You have two different users and need to trigger refreshes. or #2 You submit the form and are displaying old data. In the case of #2 this is a problem with your logic. Your script is pulling in the data before it is updated to the DB. You'll either ...