Jump to content

DaveEverFade

Members
  • Posts

    56
  • Joined

  • Last visited

    Never

Everything posted by DaveEverFade

  1. Try putting this at the top: <?php error_reporting(E_ALL); ini_set('display_errors', '1'); It will help you identify the errors... Also the action in the form seems a bit odd to me... That should be where you are posting the info to...
  2. try mysql_real_escape_string() should do it I think.... Oh, and you need to do that before you run the query ie <? $query = "SELECT DISTINCT story_id, headline FROM cms_stories WHERE (headline LIKE '%$related_term_one%' OR headline LIKE '%$related_term_two%' OR body_text LIKE '%$related_term_one%' OR body_text LIKE '%$related_term_two%') AND story_id != $story_id ORDER BY story_id DESC LIMIT 5"; $query=mysql_real_escape_string($query); $result = mysql_query($query) OR die(mysql_error()); ............
  3. You're not catching the mysql_error() in there. Try that to see what the error is. Also try echoing $sql to check it's ok. Another favourite of mine when debugging is putting this right at the top (just after <?php) error_reporting(E_ALL); ini_set('display_errors', '1'); If you can't resolve the issue using the errors, post them back in here...
  4. You could try putting the results in a hidden field (using javascript) then submit the form? You might have problems with an array there so if I were you i'd concatenate the values of the select box (using somthing like |) then explode the results on the PHP page.
  5. Can you post the error you're getting here please?
  6. You don't have a { here: if (isset($_GET['ID_No'])); You would then also need to close this
  7. Oh no, hang on... they're being created dynamically using php is it? If so, is that source right? You're loading the root but you have a ../ in there...
  8. Doesn't work for me.. the url for one of the images (as an example) is: http://www.oakleasing.com/phpthumb/phpThumb.php?src=../upload/car_77.jpg That aint right!
  9. This should do it... <?php foreach($photos as $x) { ?> <img src="<?php print($x['url']); ?>"> </img><a href="<?php print($x['url']); ?>">Link text</a> <?php } ?>
  10. Yeah, sorry about that one.. I'm always leaving the () off. There were some much more in depth solutions after mine, so take your pick..
  11. You have a question mark in the DB name. Is that supposed to be there?
  12. Before the " or ' you need a \ so it would be echo "some words \"Quote\" more text "; etc...
  13. When connecting make sure you have the mysql_select_db mysql_connect('host', 'user', 'password'); @mysql_select_db("db_name") or die(mysql_error);
  14. Sorry, just tested, you are right... I must have been thinking about somthing else..
  15. Cookies can hold arrays, i've done it before (by accident). Although I don't know how to do that in javascript!
  16. change all your $_post to $_POST They are case sensitive and need to be in capitols Dave
  17. try putting this at the top of your page: error_reporting(E_ALL); ini_set('display_errors', '1'); before you define $con. This may help diagnose the problem. I could be wrong here but should there not be a '@' before mysql_select_db?
  18. The problem is that I need the function name in quotes because it wont always be a function name. It may be a somthing like 'id=2' at the moment I have a rather large switch on it but it's just getting too big. Can I turn it back into an object maybe?
  19. It's a very long and complex code but essentially I would pass the function name through another function onclick so eg: <img onclick="Test('Test2')"> function Test(params) { params() } function Test2() { do what I actually need to do.. }
  20. How can I call a function dynamically? I assumed i could do it like this: function (param) { param() } ...but that doesn't work Any ideas? Dave
  21. I got around it another way buy changing window.status when readyState<4 then putting an if right at the start to see what window.status was. Many thanks anyway...
  22. I have a page using several ajax'ed objetcs (all using the same ajax function). One of the objects loops and does an Ajax refresh every 20 seconds. Unfortunately, somtimes the responses get mixed up and the response from one goes into the incorrect div. I tried to get around it by putting this at the start of my ajax function: XMLHttpRequest=null To make sure there are no current requests but we still get problems. Any ideas? Many thanks Dave
  23. I'm trying to run the following query but I'm getting confused: SELECT teamid from recognition_teams order by (SELECT count(*) from recognition_scores where (team_1=teamid and team_1_score > team_2_score) or (team_2=teamid and team_2_score > team_1_score)) To explain what I'm trying to achive: I'm trying to get the teamid from one table but I want the order to be by the amount of wins in the scores table. So I want query to count the amount a team has a greater score than any other then order by the greatest... Any ideas anyone? I've done something like this before but can't remember of find the file... Ta 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.