Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Everything posted by ober

  1. In response to a PM, I will agree that this is not spam. The only way I can see this even being possible is through some back-end application that has the ability to create cron jobs or scheduled tasks. PHP has no mechanism that I'm aware of that will create a time-based event like this.
  2. I'm not sure exactly what you're getting at. The only time I move queries to an include is if the WHERE clause gets really big and eats up a lot of page real estate. And if the query and resulting display work is only used once, I usually keep it on the same page. However, if you're doing a ton of formatting or setup work to display the results of the query and you have several of those, that's when I start to split it out. I have several pages that are nothing but includes to different reports since I have one page that all my reports get printed from in one of my applications. Then I just include whatever report is called from the switch(). Quick question though... why use ADO? Unless you're using something like Access or MSSQL with field names > 30 characters, there's no reason not to use the built in libraries. ADO is really messy and not nearly as nice to deal with.
  3. You can pass arrays, yes. Like if you have a bunch of checkboxes, just name them like this: mycheckboxes[] Then in your processing: [code]foreach($_GET['mycheckboxes'] as $key)    echo "$key<br>";[/code]
  4. I will allow answers to the proxy question, but any responses to referrer spoofing will be deleted. You've been warned, superpimp.
  5. Heh... I didn't know about end().
  6. Umm... that's still confusing, but if I understand you correctly, you should change it to this: [code]<td align="left">'. $row['type']. '</td>                          <td align="left">'. $sleeps . '</td>                          <td align="left">'. $board . '</td>                          <td align="left">'. $row['description']. '</td>                          <td align="left">'. $pets_allowed. '</td>                          <td align="left">'. $row['price']. '</td>[/code]
  7. I'm not sure why you would ever want to use JavaScript to echo a PHP error message unless you want to do it with a pop-up. The preferred method is always going to be via PHP.
  8. The best way to go about this is to insert parts of the record as you go along. So you're actually storing it into the database. Then when you get to the end of the forms, you set a column to 1... (initially setting this to 0). So if someone exists the form early, you know it because that field will be 0. Then whenever a full set of forms does get submitted (or someone starts a new one), just run a simple script to delete everything out of the database that has a 0 in that field. You're also going to want to check a date field, because to concurrent sessions could delete one or the other. I hope that makes sense.
  9. You're going to have to use a counter of some kind, but count($array_name) will give you the number of items in the array (starting at 1, the indexes of the array start at 0).
  10. I don't think you're going to find anything that's going to make it that easy.
  11. SELECT SUM(field_name) AS mysum FROM tablexyz
  12. I'm running PHP 5 with MSSQL 2K, no issues.
  13. Keep in mind that you'll have to enable the mssql extension in php.ini. Changing between the 2 is very simple, however. Just change all the function calls to mssql_query (for example) instead of mysql_query. Also keep in mind that you won't have access to things like LIMIT/mysql_error().
  14. That's the most efficient way to achieve your required results, so that's what I provided. You didn't specify. array_unique will probably get you what you want, but I'm going to assume that's probably to simple for what you're after, so the only thing left is to copy used array values to a temp array and then use in_array to check that for "used" array values.
  15. I showed up friday night and Eric was in there with one other person on the other team. I think they were squatting, because I didn't see anyone else in there and Eric didn't respond to my messages. I've seen the server packed before, but it wasn't on a map I was interested in at the time. I did have a 1 hour long battle on Kubra last night though... it was KICKASS. I was commander for the US and it was neck and neck for a while... we ended up winning by about 53 or something.
  16. Check the permissions on the PHP scripts you're trying to run. Make sure other scripts have the ability to run them (or use chmod 777 on them just to be safe).
  17. SELECT DISTINCT(supplier_name), other_field1, otherfield2 FROM tablexyz WHERE blah blah
  18. You never fetch the data: $row = mysql_fetch_array($result); I also don't know what you mean by your last statement.
  19. For dynamic content, the only good way is to have a catalog of translatable words. There isn't going to be an easy fix for this one.
  20. You have to use number_format() to display any kind of precision, unless MySQL provides a number formatting function.
  21. A cursor is a pointer within a recordset returned by the DBMS. There should be no reason to extract anything from the cursor. You just use it to change the position within the recordset.
  22. Your idea is a little confusing as you put it, but I think you can probably do what you're suggesting by having the link call a quick javascript function that'll grab the text from the correct box and then redirect the user the page that handles the chosen text. It's hard for me to specify anything more since I don't know where the info is coming from, how much of it there is, or what you're doing with it on the other end. Do you have a website we could look at?
  23. I'm not sure that's even possible. You have to have the ability to run filesystem functions on the server you're talking to, and I'm about 95% sure you'll have to be running your scripts on that specific server instead of against it.
  24. Did you chmod the upload/moved to folder to 777?
  25. 1) Are you getting any errors? 2) Is $_GET['story_id'] a string or an integer? 3) You're not verifying the UPDATE. You display a success message no matter what happens. [code]$result = mysql_query("UPDATE tablex SET .... ") if($result)    echo "success message"; else    echo "error message";[/code]
×
×
  • 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.