-
Posts
24,563 -
Joined
-
Last visited
-
Days Won
822
Everything posted by Barand
-
how can i create triggers in mysql using php
Barand replied to shwetapandit's topic in PHP Coding Help
Nor was the question about PostgreSQL being able to run commands. -
try $result = mysql_query($sql) or die(mysql_error());
-
how can i give text HTML formatting after a usser subits a form
Barand replied to Baxt01's topic in PHP Coding Help
cataiin, No. Use nl2br() on output in the browser. Store data with just the newlines. -
If you get an "undefined variable" message it means what it says. You are using a variable that has not been given a value previously in the script.
-
As we have no idea what $sql contains then what do expect us say? Have you tried checking what mysql_error() returns after running the query? That call to mysql_real_escape string() does nothing and is totally useless. What does this have to do with maths (this is the php maths forum)?
-
Old proverb: "The only stupid question is the one that wasn't asked"
-
Based on my previous reply, SELECT r.roomid, r.`room-name`, r.price, r.`room-descript` FROM rooms r LEFT JOIN order o ON r.roomid = o.`room-id` AND o.checkin < '$checkout' AND o.checkout > '$checkin' WHERE o.`room-id` IS NULL DO NOT use "-" in column names (SQL treats them as minus signs). Use underscores "_"
-
In the diagram below, rooms E and F are available between the requested checkin and checkout dates. The test for a room being booked for all or part of the requested period is S < checkout AND F > checkin A LEFT JOIN between all rooms and rooms booked will give those available requested requested checkin checkout | | Room A S------------------F | Room B | S---------------F | Room C | S-------------F Room D S----------------------------------------F Room E S------------F | | Room F | | S-------------F
-
The values need to be inside ()s INSERT IGNORE INTO table (a, b) VALUES (1,2) Edit: Ignore
-
your date range test should be if(($today>=$remainder_date) && $today<=$renew_date)
-
Then you need to subtract a month from the expiry date and check if today is between that date and the expiry date
-
Use commas, not semicolons, to separate the individual records. INSERT INTO table (a,b,) VALUES (1, x), (2, y), (3, z); Semicolon terminates query
-
or you could GROUP BY agent and GROUP_CONCAT the house details into a single field ready for emailing. Let the database query do the work.
-
So you're talking about tens of millions then?
-
try mysqli_fetch_row() instead of mysqli_fetch_assoc()
-
If T1, T2 and T3 all have the same fields then why on earth are they three separate tables? Use a UNION.
-
How to GET SQL row using Textarea to type the ID or NAME for Row or ID?
Barand replied to Miklo's topic in PHP Coding Help
:code_tags: -
Why "60" when the requirement is for 1 month?
-
priyankagound, That's a solution looking for a problem, unfortunately not this one. And you should have learned to use code tags by now
-
priyankagound, keep up and read the previous reply by mac_gyver
-
Grab the value from the dropdown list and check against ...
Barand replied to halben's topic in PHP Coding Help
perhaps if ($someRole == $_POST['role']) && ($someRole == 'subscriber') { update_something(); } $_POST is not same as $_Post -
SELECT * FROM `dailyMasterLogs` AS logs LEFT JOIN `vessels` AS vessel ON logs.logVesselID = vessel.vesselName WHERE logs.logVesselID = foo ORDER BY $field $order
-
So are you saying that writing "hello" to a numeric type column would be better than writing 0? If the input is supposed to be an integer then intval() will ensure it really is.
-
Debug PHP code at run-time (step-over) with breakpoints
Barand replied to softsolutions's topic in PHP Coding Help
http://www.nusphere.com/products/php_debugger.htm