Jump to content

chewson

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

chewson's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Writing a php script to select data from mysql data base and populate a html table. continue getting the following message Parse error: syntax error, unexpected T_LNUMBER in /home/chewson1/public_html/nurse_certification/dept_rpt.php on line 11 code is: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <title>DEPARTMENT REPORT</title> 6 </head> 7 <body> 8 9 <?php 10 11 include_once('connectvars.php'); 12 $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) 13 or die('Error connecting to MySQL server.'); 14 15 $query = "SELECT cr_id, cr_empl_num, cr_ci_num, cr_cert_exp_dte, cr_flag, ci_num, ci_desc, ci_authority, ce_dpt, ce_name, ce_email, ce_phone_ext, ce_empl_num, cd_email, cd_num 16 FROM certification_record, certification_info, certification_employee, cert_department 17 WHERE cr_empl_num = ce_empl_num 18 AND ce_dpt = cd_num 19 AND cr_ci_num = ci_num 20 AND cr_flag > '00'"; 21 22 23 $result = mysqli_query($dbc, $query) 24 or die('ERROR querying database'); 25 ?> 26 27 <table border=1 style="background-color:#F0F8FF;"> 28 <caption><EM>Nurse Certification Report</EM></caption> 29 <tr> 30 <th>Department Number</th> 31 <th>Employeer Number</th> 32 <th>Employee Name</th> 33 <th>Employeer Email</th> 34 <th>Employeer Phone Extention</th> 35 36 </tr> 37 38 <?php 39 40 WHILE ($row = mysqli_fetch_assoc($result)) { 41 echo "</td><td>"; 42 echo $row['ce_dpt']; 43 echo "</td><td>"; 44 echo $row['ce_empl_num']; 45 echo "</td><td>"; 46 echo $row['ce_name']; 47 echo "</td></tr>"; 48 echo $row['ce_email']; 49 echo "</td><td>"; 50 echo $row['ce_phone_ext']; 51 echo "</td><td>"; 52 } 53 echo "</table>"; 54 55 56 ?> 57 58 </body> 59 </html> 60
  2. I need to write a Task Initiator for a server. My host tells me I can do this using CRON & LENUX. Anybody know how?
  3. This worked. Thank you very much. I have another topic - does anyone know "CRON" and LENUX I need to write a 'Task Initiator ' for a server, my host tells me I can do this using CRON,and LENUX.
  4. I am selecting records that fall between a 60 and 90 day expiration date. I report these records, but need to update the associated flag so that the records will not be accessed again on other searches.
  5. The response i got was that the query was not executed- Why? I echoed all the selected fields and the data was there . I don't understand why the query was not executed. Help!
  6. I am attempting to update selected records using '$row[' elements in where clauses. I recieve message 'Record Updated but when I check data base it hasn't changed. CODE: $query = "SELECT cr_num, cr_ci_num, cr_dte, cr_flag, ci_desc, ci_authority, ce_name, ce_email, ce_phone_ext FROM c_record, c_info, c_employee WHERE cr_num = ce_num AND cr_ci_num = ci_num AND cr_dte > '{$dte60}' and cr_dte <= '{$dte90}' AND cr_flag = '00'"; $result = mysqli_query($dbc, $query) or die('ERROR querying database'); while($row = mysqli_fetch_array($result)) { $query = "UPDATE c_record SET cr_flag = '90' WHERE cr_num = '{$row[cr_num]}' AND cr_ci_num = '{$row[cr_ci_num]}'" or die('ERROR UPDATE'); echo 'Update succesfull'; echo "<br />\n"
  7. Thank you very much Kira. That worked, but now how do I use variable in a MYSQL SELECT statement for example $query = "SELECT * FROM A_record WHERE A_dte <= $dte90";. Dte90 was calculated using your routine.
  8. THANK YOU, BUT STILL HAVE A PROBLEM WITH MY SCRIPT "Parse error: syntax error, unexpected T_LNUMBER in /home/chewson1/public_html/nurse_certification/TEST_DTE.php on line 11 THE SCRIPT IS: <h1>TEST DATE PROCESSING</h1> <?php $sql = "SELECT "2011-10-12" + INTERVAL 90 DAY as date90"; $res = mysqli_query($mysqli, $sql); if ($res) { $DATE_90 = date90; echo $DATE_90 } ?>
  9. Attempting to set a variable = NOW() + INTERVAL 90 DAY; I can run SELECT DATE_ADD(NOW(), INTERVAL 90 DAY using MYSQL, but don't know how to move result to a variable.
×
×
  • 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.