-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
You need to make a better effort here if you want help. Be more specific than "It doesn't work." Remove your error suppressions and add some error messaging to your stuff. Example, change this: $gotten = @mysql_query("select * from pix order by pid desc "); to this (on all of your mysql_.xxx functions) $gotten = mysql_query("select * from pix order by pid desc ") or die(mysql_error());; Any error messages? Echo all your vars out, do they contain what you expect?
-
Then make use of arrays, as GingerRobot suggested. Better yet, put your data into a database instead of hardcoding it (then put it into an array when needed).
-
depends on where you're getting the data from.
-
You can do that? Sweet. Thanks Scott. That's fine and dandy if all the players have 10hp and can never have more. I would have a separate column called "regen" or something and have the cronjob inc it for everybody every 1m. Then when an individual user's hp is queried (user logs in, fights, etc..whenever the script calls for it to be displayed/used), update hp to include regen amount (hp+regen but not more than maxhp), and reset the individual user's regen back to 0.
-
mysql_fetch_array() returns only 500 records. How to increase?
.josh replied to JsusSalv's topic in PHP Coding Help
All else fails you could always break it down into several queries with offset limits...but I think the problem is more along the lines of what PFM is saying. -
($x / $y) * 100 example: If you have 65 beans, and 23 are black and 42 are white, what percentage of black and white beans are there? (23 / 65) * 100 = 35.38% black (42 / 65) * 100 = 65.63% white
-
Thread closed, as it is just as pointless as all the other "help me think of a name" threads. If you come up with a list of names and want people's opinion on which one is the best, that's fine, but nobody is going to ever put a serious effort into helping think up a name, for the reason that GingerRobot stated.
-
You get the id the same way you got the rest of your information...by selecting it. Do you not have anything else selected from your db? Your OP suggest that you do...
-
[SOLVED] Inserting IP ADDRESS into mySQL using a PHP form
.josh replied to webmaster1's topic in PHP Coding Help
ip address is a string type. use varchar -
if that's where you have your query result article id stored, then yes. And then on the next page, you can access that id from $_GET['innleggID'] and run a query based off that. edit: well I think you have your quotes wrong.. <a href="showarticle.php?innleggID=' .$result->ID. ' ">read more</a> should be something like echo "<a href='showarticle.php?innleggID=" .$result->ID. "'>read more</a>";
-
put the article id in the link and then select the article from the db from the passed id.
-
The manual provides an example. Follow the link.
-
Help with making mp3s available for download on my website
.josh replied to turkman's topic in PHP Coding Help
you probably mispelled it, or did not use the right path, or uploaded it to the wrong folder, etc... -
You coded a fully functioning shopping cart, and yet can't figure out if there's a way to not factor one variable into an equation?
-
hmm I guess one of the admin must have just deleted that forum. It's been inactive for a while...
-
I don't think php offers any built-in commands for that sort of thing, and as far as I know, there are no "official" extensions that do this, either. However, you may possibly be able to make use of com and/or exec to work with some other existing program.
-
well I was thinking maybe if you shutdown the service and/or process related to it, it would close the socket. Other than that, I don't think (again, not 100%) windows really has a built-in socket "manager." I know there are lots of programs you can dl that help out in that dept, or you can program your own through java, c++, vc, etc...
-
well he does have a var between his option tags... alter this line of code to the following: $RESULT= MYSQL_QUERY($QUERY) or die(mysql_error());
-
possibly through task manager but not 100%
-
[SOLVED] Problem with adding Table to this piece of code.
.josh replied to Dekken's topic in PHP Coding Help
You're not going to be able to properly do your tables with 3 separate loops like that. Store each regex result into a separate array (or 1 multidim array) and then do 1 loop. Example: <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1255"> <title></title> </head> <?php $fileName = 'file_name.txt'; $fileBody = file_get_contents($fileName); //Date if (preg_match_all('/\[CloseDate](.*?)\[CloseDate]/', $fileBody, $matches)) { $words['date'] = $matches[1]; } //Kurs if (preg_match_all('/\[CloseKurs](.*?)\[CloseKurs]/', $fileBody, $matches)) { $words['kurs'] = $matches[1]; } // Subject if (preg_match_all('/\[CloseSubject](.*?)\[CloseSubject]/', $fileBody, $matches)) { $words['subject'] = $matches[1]; } echo "<table>"; $total = count($words['date']); for ($x = 0; $x < ($total - 1); $x++) { echo "<tr>"; echo "<td>{$words['date']}</td>"; echo "<td>{$words['subject']}</td>"; echo "<td>{$words['message']}</td>"; echo "</tr>"; } echo "</table>"; ?> </html> -
We had a contest a while back that involved making a graphing calculator. Do a forum search.
-
Yes. ...or were you really asking for someone to rewrite your code for you?
-
[SOLVED] Problem with adding Table to this piece of code.
.josh replied to Dekken's topic in PHP Coding Help
Personally I would use a database but if that's not a route you're willing or able to take, I would look into xml. What you're doing is the same general principle. -
Did you read the notes for socket_close?
-
[SOLVED] Problem with adding Table to this piece of code.
.josh replied to Dekken's topic in PHP Coding Help
we'd have to see file_name.txt to figure out if there's a more efficient way of doing that.