Skip to content

Instantly share code, notes, and snippets.

@gsmcwhirter
Created July 9, 2010 20:14
Show Gist options
  • Save gsmcwhirter/470000 to your computer and use it in GitHub Desktop.
Save gsmcwhirter/470000 to your computer and use it in GitHub Desktop.
<?php
function scheduleLinkGetScheduleId($id = false) {
$query = "
SELECT
schedule_id
FROM
schedule_links
WHERE
deleted = 0
";
if ($id) {
$query .= " AND location_id = $id";
}
if($result = mysql_query($query)) {
if (mysql_num_rows($result)) {
$ret = array();
while ($row = mysql_fetch_assoc($result)) {
$ret[] = $row;
}
return $ret;
}
else{ echo "no rows"; }
}else{
echo "should be error here: ". mysql_error();
}
return false;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment