Hi all I am new to the forum I have been given the job of doing some work on our osticket system database, because I am the only one who knows some html (or the word html). I have no experience with php but am keen to lean / upskill 8)
I have managed to create a table in mysql and now I have no idea how to modify an existing piece of code to query the db and return the results.
It has taken me a week to do and I am now working after hours (so I donât look to stupid at work:P)
Now itâs saying unexpected T_STRING, expecting â]â on line 80
I have been going crazy trying to find the missing ] can some one please help me?
[php]<?php
require(âstaff.inc.phpâ);
$page=ââ;
$answer=null; //clean start.
$nav->setTabActive(âdirectoryâ);
$nav->addSubMenu(array(âdescâ=>âStaff Membersâ,âhrefâ=>âdirectory.phpâ,âiconclassâ=>âstaffâ));
$nav->addSubMenu(array(âdescâ=>âVenueâ,âhrefâ=>âvenue.phpâ,âiconclassâ=>âpremadeâ));
$nav->addSubMenu(array(âdescâ=>âNew Venueâ,âhrefâ=>âadd_venue.phpâ,âiconclassâ=>ânewPremadeâ));
require_once(STAFFINC_DIR.âheader.inc.phpâ);
$query=sprintf(âSELECT * FROM ost_venue;â);
$result=mysql_query($query);
// Count table rows
$count=mysql_num_rows($result) or die(mysql_error());;
print â$count venue foundâ;
?>
|
// Check if button name âSubmitâ is active, do this
if(isset($_POST[âSubmitâ])){
for($i=0;$i<$count;$i++){
$sql1=âUPDATE ost_venue SET isenabled=â$ISENABLED[$i]â, Category=â$CATEGORY[$i]â,sn=â$SN[$i]â, name=â$NAME[$i]â, venue_name=â$VENUE_NAME[$i]â, number=â$NUMBER[$i]â, venue_number=â$venue_number[$i]â, updated=NOW() WHERE id=â$id[$i]ââ;
$result=mysql_query($sql1);
if(isset($DELETE[$i])){
$sql2=âDELETE from ost_venue WHERE id=â$DELETE[$i]ââ;
$result2=mysql_query($sql2);
}
}
?>
<?}
mysql_close();
require_once(STAFFINC_DIR.âfooter.inc.phpâ);
?>[/php]