Jump to content

bh

Members
  • Posts

    238
  • Joined

  • Last visited

Everything posted by bh

  1. Hi, its a bit tricky. I tried to implement the order by what you said. I figured out that you can use an expression in your ORDER BY clause. With the expression you can do the DESC order with 0s coming to first. Heres the query. I hope it helps. SELECT number FROM temptable ORDER BY number=0 DESC, number DESC;
  2. Hi, try to use the wildcard operator: 'ronnie*'. But if your searched text sg like this '"some words"', it will search exactly the words: 'some words'. full-text manual
  3. bh

    GET

    Hi, You can get the entiry URL with $_SERVER['REQUEST_URI']. And you can get info about the string length with strlen. What can be the maximum length of the variable? link
  4. Yeah, youre right, my mistake. Anyway in file3.php you didnt include file2.php i think. Edit: If you get index.php only its working, but if you get file3.php it has a problem
  5. LIKE '%siemens%' OR '%6s% OR manufacturers.ManufacturerID = parts_table.ManufacturerID AND manufacturers.ManufacturerName LIKE '%siemens%' OR '%6s% Well, wheres your 'LIKE' clause eg. before your %6s% ?
  6. in your foreach at $queryext .= " '%$current%' OR" ; after the first cycle you havent got 'LIKE' before your '%$current%' ....
  7. Hi, try to use your variable as a global.
  8. bh

    Deleting files

    Yeah, its better than use exec function.
  9. Yeah, just up with the head.
  10. [off] we did everything, let him away [/off] sorry for the off
  11. Dont you see the difference the two lines? Look it again. it is one array element, cuz its a string "BB, BB, BB" this line is two array elements "BB", "BB" array("BB, BB, BB"); -> one element array("BB", "BB", "BB"); -> three elements Here array_rand($input4, 2); $input4 is an array which has one element and you want to choose randomly two...
  12. bh

    Deleting files

    is your $path and $command content correct? Is there a space at the beginning of the $path? $command = "rm -Rf".$path."*";
  13. Hi, your array has only one element: $input3 = array("BB, BB, BB, BB, BB, BB, BB, BB, BB, bb"); -> $input3 = array("BB", "BB", "BB", ..., "bb");
  14. The query its ok, so you should check your datas. SELECT DATE_FORMAT(so_start_date, '%e') from company;
  15. Hi, Simply remove the single quotes. SELECT * FROM company WHERE so <> 0 AND so_active = 'yes' AND DATE_FORMAT(so_start_date, '%e') BETWEEN 5 AND 26 ORDER BY company_name ASC
  16. DELETE People, PeopleCon FROM People LEFT JOIN PeopleCon ON People.Pid = PeopleCon.Person_id WHERE People.Pname = 'Peter Kay' OR People.Pname = 'Jake Welsh'; ?
  17. The "Replace into" statement helps you.
  18. Hi, foreach ($xml->xpath('//distance[last()]') as $distance): ?
  19. str_replace
  20. Maybe becouse you use an alias... ? $query=mysql_query("SELECT * FROM gallery a JOIN gallery_image b ON a.id = b.gallery_id where gallery_id=$gallery_id order by b.priority");
  21. Hi, Your "$strtotime" variable probably is not a correct format for DateTime. $csv .= "Payment,".newdate("m/d/Y",newstrtotime("+".$periodic[0][0]." days")).",".$row['amount'].",".count($periodic).",".$row['frequency'].",".newdate("m/d/Y",newstrtotime("+".$periodic[$perCt][0]." days"))."\n"; function newstrtotime($strtotime){ try { $datetime = new DateTime($strtotime); return $datetime->format("U"); } catch (Exception $e) { // echo $e->getMessage(); // if you wanna know the error message return NULL; } ... If you use the procedural constructor you cannot catch any exceptions. So thats why the OOP's mode.
  22. Yeah, its my fault Of course it should be "NOW()" Select videos.*, categories.cat FROM videos, categories WHERE videos.cat_id = categories.id AND videos.status ='1' AND videos.dateposted >= DATE_SUB(NOW(), INTERVAL 24 HOUR) ORDER BY (videos.up-videos.down) DESC LIMIT $start, $limit;
  23. bh

    PHP MAILER

    Hi, You should start a tutorial: Google
  24. bh

    query help

    SELECT COUNT(patientid) FROM event WHERE event = 'Registration' AND FROM_UNIXTIME(event_time) >= '$startdate' AND FROM_UNIXTIME(event_time) <= '$enddate'; At the end of the second there was an unnecessary parenthesis.
  25. bh

    query help

    SELECT COUNT(patientid) FROM event WHERE event = 'Registration' AND ((FROM_UNIXTIME(event_time) BETWEEN '$startdate' AND '$enddate') OR FROM_UNIXTIME(event_time) = '$startdate'); or SELECT COUNT(patientid) FROM event WHERE event = 'Registration' AND FROM_UNIXTIME(event_time) >= '$startdate' AND FROM_UNIXTIME(event_time) <= '$enddate');
×
×
  • 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.