Jump to content

MattDunbar

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by MattDunbar

  1. If you just want to do mobile sites (html optimized for smaller screens), I'm pretty sure any of them would work fine. If you're looking to build installable apps, you wouldn't be using PHP.
  2. Try this, on the line where the query should be happening: echo "UPDATE global SET status='$status' WHERE id='1'"; I'm curious to see if $status is being set. If not, and the query was "SET status='' WH..." that would at least help source the error.
  3. Depending on the version of mysql, you might be able to get away with doing it all in one query. Regardless, here's a decent way to do it, using 2 queries that will work on nearly any version of MySQL: $result = '1,2,3';//in reality, you're going to get this through a query instead, not assigning it by hand. $newQuery = 'SELECT * FROM table2 WHERE somevalue IN ('.$result.')'; You could also explode it as mentioned above, and individually deal with the records in a loop. E.g. $result = '1,2,3';//in reality, you're going to get this through a query instead, not assigning it by hand. $resultArray = explode(',',$result); for($i=0;$i<sizeof($resultArray);$i++) { $newQuery = 'SELECT * FROM table2 WHERE somevalue = '.$resultArray[$i]; }
  4. I'm assuming you're dealing with timestamps as you didn't specify how times are stored, however this should be pretty simple for most other types. Also, my queries are very basic and doesn't touch on days of the week - I've left a bit of the easier things for you to do yourself. Then when doing the SQL select, try these queries: -Find anything with a start time during the new period. If count doesn't equal 0, it means that the time is taken. SELECT COUNT(*) as count FROM tCourse WHERE Start_Time >= (the start timestamp) AND Start_Time <= (the end timestamp) -Find anything with a end time during the new period. If count doesn't equal 0, it means that the time is taken. SELECT COUNT(*) as count FROM tCourse WHERE End_Time >= (the start timestamp) AND End_Time <= (the end timestamp) Now, the tricky part is finding things that fit completely within another time period. For example, 2PM - 6PM and inside of it, 3PM - 4PM To do that, we can use this query: SELECT COUNT(*) as count FROM tCourse WHERE Start_Time < (starting timestamp) AND End_Time > (ending timestamp). I'm pretty sure I've covered every scenario here, but I don't have the time to test it out myself right now. If I missed anything, post it and I'll try to come up with a query for you. You might also be able to combine a few of these queries into one by using OR statements. Theres a few ways this could be optimized.
  5. The if statement has a few more brackets than it needs, this would suffice: if ($rpos>=$count && $rpos<($count+20)) I'm not really sure if it can be improved. You'd need to explain the purpose of the code.
  6. Make sure that you fully comprehend what OOP is first. Don't look for OOP tutorials specific to PHP, look for a definition or explanation of OOP not specific to any programming language. This works: http://en.wikipedia.org/wiki/Object-oriented_programming Now, learn the terms (read the ones that you aren't familiar with): http://en.wikipedia.org/wiki/List_of_object-oriented_programming_terms After doing all that, you should be ready for a php-specific tutorial.
  7. Your going to want to search WHERE newsitem=newsitemID or similar
  8. Not the best, but a great start. Try using some different fonts, also, I would consider changing the colors. Based on the header and the blue background on the sides I am seeing a colorful look, but the whole center of the page is grays. So dull when placed next to color (usually, you would put the colorful on the parts you want the user to focus in on). As per selling the template. Try Sitepoint, digital point, or put up your own site for selling templates!
  9. I'll add that you'll probably want to link to an encoded version of the video, or an ID and have the flash item call PHP to check the file name that it will catch. There is no way to completely avoid video download possibilities but you can make it reasonably hard for them, or at least force the user to install an FLA extractor.
  10. Lock files while editing and get a way faster server if its taking that long to load pages. You could also que certain things like password changes, registrations etc to happen on a cron job so there is a small delay. To make the software Out-Of-The-Box-Ready, make it run remotely, handling data on your server, giving each app a dynamically generated API key and pre-inserting that into the user's download.
  11. Simply code the template to have a floating box in CSS and HTML OR use Javascript to show a fancy little box. No PHP will be used so I'm going to recommends this gets recreated in the the HTML/CSS/JavaScript Forums then closed or deleted here.
  12. Shouldn't be an issue, every post in the forums is loaded into a huge string variable. 10 to 20 large strings can be loaded into a page if you open an active thread on these forums as well. As a general statement, it won't hurt. But, you might want to consider letting the body be built as an object itself, allowing you to add things such as links through functions allowing for no HTML knowledge. It could be done so many ways, its all up to you really.
  13. Most importantly, if you are running a contest track the winners IP and check how many votes are registered from a single IP most likely theirs.
  14. If your client said cookies are okay, just use them. If anything store an IP address and a question/picture id but then you'll have to worry about Dial Up users who share an IP address. SampleTable: IP,voteon 127.0.0.1,52 127.0.0.1,55 Then you could simply SELECT * FROM tablename WHERE ip='127.0.0.1' AND voteon='52' then run mysql_num_rows, if 0 is returned they haven't voted.
  15. 1. http://www.pixel2life.com/search/php_coding/Private%20Message/1/ That page lists 2 tutorials. 2. Thats fine, but maybe reading through a tutorial will help explain how the ID system would work.
  16. Hmm, perhaps you should look into following a tutorial to make this PM system. A rewrite will likely be needed.
  17. No problem, If you need any further assistance feel free to contact me through PM, IM or Email.
  18. Can be done, Yes. Can be done by someone with little to no PHP knowledge, no. I recommend you find a freelancer to write this for you or buy yourself a decent book on PHP and MySQL.
  19. Try explode('@',$email); Sorry, I made a mistake in the function syntax.
  20. You're going to need to add a unique ID for each message in the database.
  21. Well, then I guess you're going to need to get to more difficult debugging. Try adding things such as echoing mysql_num_rows($result) check that it is grabbing the right data. Tell me if that returns the correct number of rows.
  22. You could always look into the paypal API and code it yourself if you know PHP it won't be too much harder.
  23. Make sure your PMs are linked to an ID, then use the ID as a GET Parameter and do 2 pages listing different info sets. I need too see more of the code you're using to give a more detailed description of how this would be done.
  24. print "<option value='$HouseNumber'>$HouseNumber</option>"; Replace that with: print '<option value="'.$HouseNumber.'">'.$HouseNumber.'</option>';
×
×
  • 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.