
Kenny_Luck
Members-
Posts
18 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Kenny_Luck's Achievements

Member (2/5)
0
Reputation
-
thanks for your help once again
-
So if i write SELECT RentID FROM rental WHERE NOTEXISTS (SELECT * FROM rental WHERE Dispatch <= "2019/10/8" AND Dropoff >= "2019/10/2" ) i cant made it to display the data i wanted , when i put in to the mysql to check for error it poped out something like this at the above , i need help
-
ok i solved the problem , but now there is another problem which i filtered and displayed the data that i don't one with SELECT * FROM rental WHERE Dispatch <= '2019/10/08' AND Dropoff >= '2019/10/02' , but now how do i filter the data that i wanted
-
but if i added space in between Not and Exists , it became 3 errors were found during analysis. Unrecognized keyword. (near "NOT" at position 32) Unrecognized keyword. (near "EXISTS" at position 36) Unexpected token. (near "(" at position 42)
-
SELECT RentID FROM rental WHERE NOTEXISTS(SELECT plateNum FROM rental WHERE Dispatch >= '2019/10/8' AND Dropoff <= '2019/10/5' ) SELECT RentID FROM rental WHERE NOTEXISTS(SELECT plateNum FROM rental WHERE Dispatch >= "2019/10/8" AND Dropoff <= "2019/10/2" ) LIMIT 0, 25 #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT plateNum FROM rental WHERE Dispatch >= '2019/10/8' AND Dropoff <= '2019/1' at line 1
-
so here the code that i am confusing the whole month , how can i get it to print out the filtered data $sql="SELECT COUNT(*) as conflicts FROM rental WHERE Dispatch < :dropoff AND Dropoff > :dispatch"; $stmt = $pdo->prepare($sql); $stmt->execute( [ 'dropoff' => $Dropoff, 'dispatch' => $Dispatch ]); im so frustrated on myself that cant do anything
-
I now had mostly figure out and able to run it and use it , thank you for all your help specially Barand thanks
-
if i change if($sql == 0) is still the same the value wont come out
-
Im so confuse right now
-
So this mean that this code is completely useless and i cant get the Conflicts value at all
-
I using mysqli , the code that i posted is the one i write , so you are basically saying that my query for is not run right
-
Im just learning the double prevention which im going to do for my assignment
-
i dont quiet understand what you are trying to say
-
$sql="SELECT COUNT(*) as conflicts FROM rental WHERE plateNum = $plateNum AND Dispatch > $Dropoff AND Dropoff > $Dispatch"; if("0"){ $sql="INSERT INTO rental (Rentdate,Dispatch,Dropoff,Dis_TIME,Drop_TIME,Ins,Tcost,PDcost,plateNum,userID)VALUES(CURDATE(),'$Dispatch','$Dropoff','$Dis_TIME','$Drop_TIME','$Ins','$Tcost','$PDcost','$plateNum','$userID')"; $result=$conn->query($sql); }else{ echo"Fail";} how do I get the value of the conflicts im now very clueless
-
i see thanks , if i got any problem i will ask it , thanks for your help