scootstah
Staff Alumni-
Posts
3,858 -
Joined
-
Last visited
-
Days Won
29
Everything posted by scootstah
-
Error- Cannot modify header information - headers already sent
scootstah replied to bleustreak12's topic in PHP Coding Help
Are you using CodeIgniter? If so, you're doing something very wrong...you shouldn't have any output in that file. -
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.
-
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; .
-
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.
-
You're going to need to give more information than that. What are you looking for?
-
As long as the video_id field is an integer.
-
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.
-
Increase Value In Database Every 5 Seconds
scootstah replied to oliverj777's topic in PHP Coding Help
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. -
Looks cool, but ImageMagick does all those things and much, much more.
-
With a foreach loop.
-
That's how sleep() works.
-
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.
-
Something like: $source = file_get_contents('test.txt'); $pattern = '/<blockquote class="postcontent restore">(.*?)<\/blockquote>/'; preg_match_all($pattern, $source, $matches);
-
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).
-
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?
-
I think your problem is here: if ($c > 0). It should be if ($count > 0).
-
I need your code, not a link.
-
Converting textbox new line to html new line
scootstah replied to PHPLeader's topic in PHP Coding Help
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. -
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.
-
You need to break it up into smaller batches. Instead of trying to load 5000 at once load a couple hundred or something.
-
Because you set the names to empty values.
-
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 ) )
-
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++; }
-
It won't hurt anything, because there is no valid variable there to parse.