Jump to content

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

Member (2/5)

0

Reputation

  1. thanks for your help once again
  2. 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
  3. 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
  4. 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)
  5. 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
  6. 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
  7. I now had mostly figure out and able to run it and use it , thank you for all your help specially Barand thanks
  8. if i change if($sql == 0) is still the same the value wont come out
  9. So this mean that this code is completely useless and i cant get the Conflicts value at all
  10. 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
  11. Im just learning the double prevention which im going to do for my assignment
  12. i dont quiet understand what you are trying to say
  13. $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
  14. i see thanks , if i got any problem i will ask it , thanks for your help
×
×
  • 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.