function javascript help

im new to programming and i need help on my code ? i want my page to prompt me if there will be available rooms left. im using the onload function on the admin page.so far here is my code\[code\]function prompt(){< ?php include("dbconfig.php");$sql = "SELECT COUNT(*) FROM rooms WHERE status = 'available'";$result = @mysql_query($sql) or die("Could not execute query");?> if(< ?php $result <= 14 ?>){ alert("Rooms left: < ?php echo $result ?>"); }else{ alert("Welcome Admin."); } }window.onload=prompt;\[/code\]can someone help me ? please need this code asap. thank you so muchedit:the code worked fine now but it displays "Resource id#4"? not the value of the count ?any help with this ?-renz
 
Back
Top