bh
Members-
Posts
238 -
Joined
-
Last visited
Everything posted by bh
-
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;
-
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
-
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
-
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
-
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% ?
-
in your foreach at $queryext .= " '%$current%' OR" ; after the first cycle you havent got 'LIKE' before your '%$current%' ....
-
Hi, try to use your variable as a global.
-
Yeah, its better than use exec function.
-
Yeah, just up with the head.
-
[off] we did everything, let him away [/off] sorry for the off
-
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...
-
is your $path and $command content correct? Is there a space at the beginning of the $path? $command = "rm -Rf".$path."*";
-
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");
-
The query its ok, so you should check your datas. SELECT DATE_FORMAT(so_start_date, '%e') from company;
-
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
-
DELETE People, PeopleCon FROM People LEFT JOIN PeopleCon ON People.Pid = PeopleCon.Person_id WHERE People.Pname = 'Peter Kay' OR People.Pname = 'Jake Welsh'; ?
-
The "Replace into" statement helps you.
-
Hi, foreach ($xml->xpath('//distance[last()]') as $distance): ?
-
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");
-
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.
-
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;
-
Hi, You should start a tutorial: Google
-
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.
-
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');