473,387 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

is there a better way of doing this?

Expand|Select|Wrap|Line Numbers
  1. function one_venue($time,$venue,$date,$code){
  2.     $qry="select * from timetable where time='$time' and date='$date' and venue='$venue'";
  3.     $rst=mysql_query($qry) or die (mysql_error());
  4.     if(mysql_num_rows($rst)>0){
  5.         $msg="An Event is holding in".$venue."at".$time.".! Please fix this event for another time or venue";
  6.         return $msg;
  7.     }
  8.     else{
  9.         one_class($time,$code,$date);
  10.     }
  11. }
  12. function one_class($time,$code,$date){
  13.     $qry="select * from timetable where time='$time' and date='$date' and code='$code'";
  14.     $rst=mysql_query($qry) or die (mysql_error());
  15.     if(mysql_num_rows($rst)>0){
  16.         $msg="An Event has been scheduled for this class at this time (".$time.")!. Please fix this event for another time";
  17.     }
  18.     else{
  19.         $msg="The event has been registered successfully!";
  20.     }
  21.     return $msg;
  22. }
  23.  
Sep 16 '09 #1
2 1194
Markus
6,050 Expert 4TB
Probably. Could you be more specific?
Sep 16 '09 #2
the first function check if there is an event holding in the chosen venue at the time the user chose if there is then the new the user have to fix the event for another time or venue this so that no 2 event will scheduled for the same venue at the same time if false then it will call the second function to check if the class is not engaged in another event its a project for school timetable
Sep 16 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: ina | last post by:
I want to walk a folder structor and group all the files by extention. Here is the code I put together is there a better way of doing this? <code> import os folderKey = "Folders" dicExt = {}...
43
by: Rob R. Ainscough | last post by:
I realize I'm learning web development and there is a STEEP learning curve, but so far I've had to learn: HTML XML JavaScript ASP.NET using VB.NET ..NET Framework ADO.NET SSL
19
by: Mary Pegg | last post by:
There's got to be a better way: if (isset($c)) echo $c."<br>"; if (isset($c)) echo $c."<br>"; if (isset($c)) echo $c."<br>"; if (isset($c)) echo $c."<br>"; if (isset($c)) echo $c."<br>"; but...
34
by: pamela fluente | last post by:
I would like to hear your *opinion and advice* on best programming practice under .NET. Given that several time we cannot change: MyCollection.Clear into the instantiation of a NEW...
33
by: pamela fluente | last post by:
I would like to hear your *opinion and advice* on best programming practice under .NET. Given that several time we cannot change: MyCollection.Clear into the instantiation of a NEW...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.