Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. Are you using CodeIgniter? If so, you're doing something very wrong...you shouldn't have any output in that file.
  2. You could try Nearly Free Speech. For a very small, simple website they are pretty damn cheap. Anything that needs a lot of bandwidth/diskspace though isn't very good.
  3. Can we see the actual database layout? Run this query and post the results (replace tablename with the name of the table): SHOW CREATE TABLE tablename; .
  4. Breaking up content over pages is called "pagination", see here: http://www.phpfreaks.com/tutorial/basic-pagination Do you really need a column to count the comments? That means that for every added or deleted comment you have to have an additional write. You could use a subquery to count how many comments for each post instead.
  5. You're going to need to give more information than that. What are you looking for?
  6. As long as the video_id field is an integer.
  7. Put quotes around the variable. WHERE video_id = '$super' LIMIT 1 Also, don't stick user input into your database like that or you will be vulnerable to SQL injection. I don't know what you're using to connect to the database so I can't offer any specifics.
  8. The ladies must love you. *cough* Sorry... Anyway, if you want to run code on specific time intervals without a user executing it (viewing the page) then you'll have to use something like a cron job.
  9. Looks cool, but ImageMagick does all those things and much, much more.
  10. With a foreach loop.
  11. That's how sleep() works.
  12. He wants to process the form when you press the enter key inside a textarea. By default a new line will be entered when you press enter in a textarea.
  13. It may seem "scary large", but for a database it's really not. That's exactly what an RDBMS is built for, and they are very good at it. You can always truncate your records or, like Muddy_Funster said you can archive them. Just as a point of reference, this board currently has 1,320,797 posts... so that's 1,320,797 rows just for posts, which hold a lot more information than what you need.
  14. Something like: $source = file_get_contents('test.txt'); $pattern = '/<blockquote class="postcontent restore">(.*?)<\/blockquote>/'; preg_match_all($pattern, $source, $matches);
  15. You'll want to normalize that a bit. Instead of having 365 price columns in the items table, make a new table called "prices" (or whatever you like). In this table have columns: item_id, price, date. This way you'll have one row per price, with a date linked to each item. It would be very easy to select data in whatever increments you like (daily, weekly, yearly, etc).
  16. You haven't posted any sample data so I have no way of knowing what kind of information you are actually storing. With that in mind, can you not just use a DATE field?
  17. I think your problem is here: if ($c > 0). It should be if ($count > 0).
  18. I need your code, not a link.
  19. You should do this conversion on output, otherwise you'll get a bunch of <br>'s the next time someone tries to edit something, which you'll then have to convert back into newlines.
  20. You don't need to cache something that isn't accessed. The general idea of caching is that when it is requested, you store it in a cache. Subsequent requests will pull from the cache until it expires, in which case it will be re-cached. If nobody ever visits Jane Doe's profile, it will never be cached. Only those that are accessed will be cached. Though if you are caching to the disk to avoid a few queries then you probably won't see any real benefit.
  21. You need to break it up into smaller batches. Instead of trying to load 5000 at once load a couple hundred or something.
  22. Because you set the names to empty values.
  23. It works for me. print_r(json_decode('{"jsonrpc":"2.0","id":"121","result":{"result":"OK","logindetails":{"token=":"68c49918c353a3e5d86d165da1cb2f72","UID":"1","snsUID":"12345","aid":"6789","name":null},"GameuserID":"1"}}')); stdClass Object ( [jsonrpc] => 2.0 [id] => 121 [result] => stdClass Object ( [result] => OK [logindetails] => stdClass Object ( [token=] => 68c49918c353a3e5d86d165da1cb2f72 [uID] => 1 [snsUID] => 12345 [aid] => 6789 [name] => ) [GameuserID] => 1 ) )
  24. Do the same thing only in the while loop. // define the number of columns per row $cols = 5; // start the counter $i = 0; while ($row = mysql_fetch_array($retd)) { $code = $row["code"]; $name = $row["name"]; if ($i % $cols == 0) { if ($i > 0) { echo '</tr>'; } echo '<tr>'; } echo("<td width=150 align=center>"); echo ("<a href=../products/info.php?scode=$code><img src=pictures/$code.gif border=0 alt=Item $name</a>"); echo ("<br><a href=../products/info.php?scode=$code><span class=fs13>$name</span></a>"); echo("</td>"); // increment the counter $i++; }
  25. It won't hurt anything, because there is no valid variable there to parse.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.