Jump to content

php_dave

Members
  • Posts

    107
  • Joined

  • Last visited

    Never

Everything posted by php_dave

  1. Hey guys, Thanks for the code - works a treat! Cheers Dave
  2. All, Sorry but I couldnt find anything under search... I have thiis statement preg_match("/^[-0-9A-Z_\[\]]+$/i", $attachname) Which is checking a filename for attachment into a forum - it is not allowing for any spaces - what do i need to change/add to allow for spaces in the filename? Thanks in advance Dave
  3. Im not 100% sure on this but if the value is a char/string you can use '%' and compare with LIKE or if the value is an int you can use a * and use =... Or it may be the otherway round!! - I have some code that does this somewhere - ill dig it out and post an example
  4. Sorry - I dont understand.. Do you mean you have a value stored in a table for example Value 20 and want to be able to increment this value or make and adition to this value in the table.. If so - i think the way I would do it would be to pull the current value and then add the change in PHP then update the field in mysql but you may be able to do this directly with something like Update my_table SET value = value + addition This is not tested though HTH
  5. This should help http://www.litfuel.net/plush/?postid=59
  6. Your welcome - glad I could help.. Site looks good!
  7. Ahhh - i see .. you cant echo the } } else { part - it has to be outside of an echo statement.... close the echo and restart one just after the else { make sense? Dave
  8. The problem is here i think <td class=\"norm\">No Stats to report</td> </tr><? } } else { <tr>; <td colspan=\"6\" valign=\"top\" class=\"NewsHeader\">Squad Roster</td>"; You are using <? short tags - can you do that?? I would change to a <?php for future portability even if your sever can. Once you change that you will probably find that you need to echo the <tr> and the <td> statements also! Hope it works Cheers Dave l
  9. Change this to this This checks if the id param has been passed (which it will have once you click the link) and executes the show detail code instead of th e squad list code HTH Dave
  10. Schilly is correct it will supress error messages for that command only.
  11. Hi, You have comments intertwining with code all over the shop - is that a direct copy and paste or a downloaded script? I would revist where you got the script from and try and get an original copy - rather than a copy and paste as this cant be the original code layout.. Issues i have seen : Line 5 : $user = blah bah .. should be on its own line Line 23: '{$user'} should be '{$user}' Line 34: more code hidden in comments Line 45: missing { Line 55: { is behind comment markers. As I say - I think you should go and re check the original script and use something like textpad when editing or copying and pasting as whatever you have used seems to have corrupted the Line breaks. HTH Dave
  12. Im quite new to normalisation myself - the only thing I would suggest looking at your table sctructure is you are storing Player as a VARCHAR? Im guessing there is a user table somwhere out there with a numeric id key? I would use that instead of a text player representation - if the table is going to get big then use reference data where ever possible!
  13. The Query is missing a ' after .php - so should read $sql = "SELECT count(*) as num FROM `c5t_comment` WHERE comment_identifier='/hotels/anglo.php'"; But is also dependant on the naming conventions of your table and fields - I would test the query in PHP myadmin or whatever DB front end you have just to make sure it returns a result - before you run in code. HTH Dave
  14. Looks like its been through a php encryptor (some people do this to protect their code). Not sure how you would decrypt it without the original proggy .. there are a few out there something like this
  15. Which suggests you are not making a connection to the db successfully - try just die("DB ERROR : ".mysql_error(); And see if that returns anything of use... Do you have error messages turned on in you php.ini file? check out the error_reporting() function to do something like this // This is the default value set in php.ini error_reporting(E_ALL ^ E_NOTICE); Just in case it is not set in you PHP.INI HTH Dave
  16. Is this the whole script you are showing us.. die("SELECT problem. Query: $sql Reason: ".mysql_error()." Page: $page while getting customer data. Ending process. Please tell the administrator about this at $webmaster_email attaching this error missage."); I cant see the red vars given any values in your script... maybe why your die message is not showing anything.
  17. Not sure I understand what you are asking for but the below Query will increment a field everytime it is called UPDATE tablename SET fieldname = fieldname + 1; That what you meant?
  18. The code that sasa wrote is explicit - For example with his code (unchanged) for $_POST vars var1, var2 and var3 you would end up $var1 = "value1" $var2 = "value2" $var3="value3" So would use them as a normal var example Echo $var1; echo $var2; echo $var3; HTH Dave
  19. Does mysql_fetch_array default to ASSOC? i would change it to mysql_fetch_assoc just to be sure this isnt the problem.
  20. Hi you need access to the information_schema schema and query the TABLES table something like SELECT information_schema.`TABLES`.UPDATE_TIME FROM information_schema.`TABLES` WHERE information_schema.`TABLES`.TABLE_NAME = 'your_table_name' HTH Dave
  21. Hey, This should work preg_match("/^[0-9]+$/", $year); Edit - Cross post!
  22. Add this to the top of your php script error_reporting(E_ALL ^ E_NOTICE);
  23. If this is a production server - check the log files (apache i assume) for the exact error - if its a non production server turn on error reporting in php.ini - so you can see a description of the error. HTH Dave
  24. Hey, Is the above the complete code? I cant see why you have to have Close tags at the beginning of the while loop - or are they supposed to close something above the loop? As a messy hack - you could do something like $tags = 0; While (.../) { // normal code if ($tags > 0) { echo ("</td></p>"); } // rest of code $tags++; } As I say not the prettiest - but without seeing all of your code I cant suggest anything else. HTH Dave
×
×
  • 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.