Jump to content

chuddyuk

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Everything posted by chuddyuk

  1. Array (     [0] => 44     [wn] => 44     [1] => 56 Schofield Street Clayton NCHA/CH     [mondayam1] => 56 Schofield Street Clayton NCHA/CH     [2] => 167 George Street Shaw NCHA/LF     [mondayam2] => 167 George Street Shaw NCHA/LF     [3] => 40 Warne Avenue Droylsden NEWC/NF     [mondayam3] => 40 Warne Avenue Droylsden NEWC/NF     [4] =>     [mondayam4] =>     [5] =>     [mondayam5] =>     [6] =>     [mondayam6] =>     [7] =>     [mondayam7] =>     [8] =>     [mondayam8] =>     [9] =>     [mondayam9] =>     [10] =>     [mondayam10] =>     [11] => 6 Galland Street Shaw NCHA/CH     [mondaypm1] => 6 Galland Street Shaw NCHA/CH     [12] => 4 Goodwood Close Shaw NCHA/LF     [mondaypm2] => 4 Goodwood Close Shaw NCHA/LF     [13] => 40 Warne Avenue Droylsden NEWC/NF     [mondaypm3] => 40 Warne Avenue Droylsden NEWC/NF     [14] =>     [mondaypm4] =>     [15] => sdas     [mondaypm5] => sdas     [16] => ds     [mondaypm6] => ds     [17] =>     [mondaypm7] =>     [18] => sadsa     [mondaypm8] => sadsa     [19] => asdasdasd     [mondaypm9] => asdasdasd     [20] =>     [mondaypm10] =>     [21] => 21 Goodwood Close Heywood NCHA/CH     [tuesdayam1] => 21 Goodwood Close Heywood NCHA/CH     [22] => 43 Warne Avenue Droylsden NEWC/NF     [tuesdayam2] => 43 Warne Avenue Droylsden NEWC/NF     [23] =>     [tuesdayam3] =>     [24] =>     [tuesdayam4] =>     [25] =>     [tuesdayam5] =>     [26] =>     [tuesdayam6] =>     [27] =>     [tuesdayam7] =>     [28] =>     [tuesdayam8] =>     [29] =>     [tuesdayam9] =>     [30] =>     [tuesdayam10] =>     [31] => 5 Ravenside Park Chadderton NCHA/LF     [tuesdaypm1] => 5 Ravenside Park Chadderton NCHA/LF     [32] => 43 Warne Avenue Droylsden NEWC/NF     [tuesdaypm2] => 43 Warne Avenue Droylsden NEWC/NF     [33] =>     [tuesdaypm3] =>     [34] =>     [tuesdaypm4] =>     [35] =>     [tuesdaypm5] =>     [36] => asda     [tuesdaypm6] => asda     [37] =>     [tuesdaypm7] =>     [38] =>     [tuesdaypm8] =>     [39] =>     [tuesdaypm9] =>     [40] =>     [tuesdaypm10] =>     [41] => 11 Roe Lane Oldham NCHA/CH     [wednesdayam1] => 11 Roe Lane Oldham NCHA/CH     [42] => 34 Duchess Park Close Shaw NEWC/LF     [wednesdayam2] => 34 Duchess Park Close Shaw NEWC/LF     [43] => 45 Warne Avenue Droylsden NEWC/NF     [wednesdayam3] => 45 Warne Avenue Droylsden NEWC/NF     [44] =>     [wednesdayam4] =>     [45] =>     [wednesdayam5] =>     [46] =>     [wednesdayam6] =>     [47] =>     [wednesdayam7] =>     [48] =>     [wednesdayam8] =>     [49] =>     [wednesdayam9] =>     [50] =>     [wednesdayam10] =>     [51] => 3 Wessex Park Close Shaw NCHA/LF     [wednesdaypm1] => 3 Wessex Park Close Shaw NCHA/LF     [52] => 45 Warne Avenue Droylsden NEWC/NF     [wednesdaypm2] => 45 Warne Avenue Droylsden NEWC/NF     [53] =>     [wednesdaypm3] =>     [54] =>     [wednesdaypm4] =>     [55] =>     [wednesdaypm5] =>     [56] =>     [wednesdaypm6] =>     [57] =>     [wednesdaypm7] =>     [58] =>     [wednesdaypm8] =>     [59] =>     [wednesdaypm9] =>     [60] =>     [wednesdaypm10] =>     [61] => 7 Melrose Street Oldham NCHA/CH     [thursdayam1] => 7 Melrose Street Oldham NCHA/CH     [62] =>     [thursdayam2] =>     [63] =>     [thursdayam3] =>     [64] =>     [thursdayam4] =>     [65] =>     [thursdayam5] =>     [66] =>     [thursdayam6] =>     [67] =>     [thursdayam7] =>     [68] =>     [thursdayam8] =>     [69] =>     [thursdayam9] =>     [70] =>     [thursdayam10] =>     [71] => 9 Chaffinch Close Oldham NCHA/CH     [thursdaypm1] => 9 Chaffinch Close Oldham NCHA/CH     [72] => 246 Hollin Lane Middleton NCHA/LF     [thursdaypm2] => 246 Hollin Lane Middleton NCHA/LF     [73] =>     [thursdaypm3] =>     [74] =>     [thursdaypm4] =>     [75] =>     [thursdaypm5] =>     [76] =>     [thursdaypm6] =>     [77] =>     [thursdaypm7] =>     [78] =>     [thursdaypm8] =>     [79] =>     [thursdaypm9] =>     [80] =>     [thursdaypm10] =>     [81] => 12 Bottomfield Higgenshaw Village NCHA/CH     [fridayam1] => 12 Bottomfield Higgenshaw Village NCHA/CH     [82] =>     [fridayam2] =>     [83] =>     [fridayam3] =>     [84] =>     [fridayam4] =>     [85] =>     [fridayam5] =>     [86] =>     [fridayam6] =>     [87] =>     [fridayam7] =>     [88] =>     [fridayam8] =>     [89] =>     [fridayam9] =>     [90] =>     [fridayam10] =>     [91] => 14 Bottomfield Higgenshaw Village NCHA/CH     [fridaypm1] => 14 Bottomfield Higgenshaw Village NCHA/CH     [92] => 21 Rooley Moor Road Rochdale NCHA/LF     [fridaypm2] => 21 Rooley Moor Road Rochdale NCHA/LF     [93] =>     [fridaypm3] =>     [94] =>     [fridaypm4] =>     [95] =>     [fridaypm5] =>     [96] =>     [fridaypm6] =>     [97] =>     [fridaypm7] =>     [98] =>     [fridaypm8] =>     [99] =>     [fridaypm9] =>     [100] =>     [fridaypm10] =>     [101] => 12 Bottomfield Higgenshaw Village NCHA/CH     [saturdayam1] => 12 Bottomfield Higgenshaw Village NCHA/CH     [102] =>     [saturdayam2] =>     [103] =>     [saturdayam3] =>     [104] =>     [saturdayam4] =>     [105] =>     [saturdayam5] =>     [106] =>     [saturdayam6] =>     [107] =>     [saturdayam7] =>     [108] =>     [saturdayam8] =>     [109] =>     [saturdayam9] =>     [110] =>     [saturdayam10] =>     [111] =>     [saturdaypm1] =>     [112] =>     [saturdaypm2] =>     [113] =>     [saturdaypm3] =>     [114] =>     [saturdaypm4] =>     [115] =>     [saturdaypm5] =>     [116] =>     [saturdaypm6] =>     [117] =>     [saturdaypm7] =>     [118] =>     [saturdaypm8] =>     [119] =>     [saturdaypm9] =>     [120] =>     [saturdaypm10] => ) Array (     [0] => 45     [wn] => 45     [1] => 6 St Marys Close Rochdale NCHA/CH     [mondayam1] => 6 St Marys Close Rochdale NCHA/CH     [2] =>     [mondayam2] =>     [3] =>     [mondayam3] =>     [4] =>     [mondayam4] =>     [5] =>     [mondayam5] =>     [6] =>     [mondayam6] =>     [7] =>     [mondayam7] =>     [8] =>     [mondayam8] =>     [9] =>     [mondayam9] =>     [10] =>     [mondayam10] =>     [11] => 244 Ashfield Road Rochdale NCHA/CH     [mondaypm1] => 244 Ashfield Road Rochdale NCHA/CH     [12] =>     [mondaypm2] =>     [13] =>     [mondaypm3] =>     [14] =>     [mondaypm4] =>     [15] =>     [mondaypm5] =>     [16] =>     [mondaypm6] =>     [17] =>     [mondaypm7] =>     [18] =>     [mondaypm8] =>     [19] =>     [mondaypm9] =>     [20] =>     [mondaypm10] =>     [21] => 6 Ravenside Park Chadderton NCHA/CH     [tuesdayam1] => 6 Ravenside Park Chadderton NCHA/CH     [22] => 29 Goodwood Drive Derker NCHA/LF     [tuesdayam2] => 29 Goodwood Drive Derker NCHA/LF     [23] =>     [tuesdayam3] =>     [24] =>     [tuesdayam4] =>     [25] =>     [tuesdayam5] =>     [26] =>     [tuesdayam6] =>     [27] =>     [tuesdayam7] =>     [28] =>     [tuesdayam8] =>     [29] =>     [tuesdayam9] =>     [30] =>     [tuesdayam10] =>     [31] => 15 Wessex Park Close Shaw NCHA/CH     [tuesdaypm1] => 15 Wessex Park Close Shaw NCHA/CH     [32] => 10 Putney Close Oldham NCHA/LF     [tuesdaypm2] => 10 Putney Close Oldham NCHA/LF     [33] =>     [tuesdaypm3] =>     [34] =>     [tuesdaypm4] =>     [35] =>     [tuesdaypm5] =>     [36] =>     [tuesdaypm6] =>     [37] =>     [tuesdaypm7] =>     [38] =>     [tuesdaypm8] =>     [39] =>     [tuesdaypm9] =>     [40] =>     [tuesdaypm10] =>     [41] => 139 Asfield Road Rochdale NCHA/CH     [wednesdayam1] => 139 Asfield Road Rochdale NCHA/CH     [42] =>     [wednesdayam2] =>     [43] =>     [wednesdayam3] =>     [44] =>     [wednesdayam4] =>     [45] =>     [wednesdayam5] =>     [46] =>     [wednesdayam6] =>     [47] =>     [wednesdayam7] =>     [48] =>     [wednesdayam8] =>     [49] =>     [wednesdayam9] =>     [50] =>     [wednesdayam10] =>     [51] => 17 Vigo Street Oldham NCHA/CH     [wednesdaypm1] => 17 Vigo Street Oldham NCHA/CH     [52] =>     [wednesdaypm2] =>     [53] =>     [wednesdaypm3] =>     [54] =>     [wednesdaypm4] =>     [55] =>     [wednesdaypm5] =>     [56] =>     [wednesdaypm6] =>     [57] =>     [wednesdaypm7] =>     [58] =>     [wednesdaypm8] =>     [59] =>     [wednesdaypm9] =>     [60] =>     [wednesdaypm10] =>     [61] => 15 Hardy Close Rochdale NCHA/CH     [thursdayam1] => 15 Hardy Close Rochdale NCHA/CH     [62] =>     [thursdayam2] =>     [63] =>     [thursdayam3] =>     [64] =>     [thursdayam4] =>     [65] =>     [thursdayam5] =>     [66] =>     [thursdayam6] =>     [67] =>     [thursdayam7] =>     [68] =>     [thursdayam8] =>     [69] =>     [thursdayam9] =>     [70] =>     [thursdayam10] =>     [71] => 4 Wimpole Street Higgenshaw Village NCHA/CH     [thursdaypm1] => 4 Wimpole Street Higgenshaw Village NCHA/CH     [72] =>     [thursdaypm2] =>     [73] =>     [thursdaypm3] =>     [74] =>     [thursdaypm4] =>     [75] =>     [thursdaypm5] =>     [76] =>     [thursdaypm6] =>     [77] =>     [thursdaypm7] =>     [78] =>     [thursdaypm8] =>     [79] =>     [thursdaypm9] =>     [80] =>     [thursdaypm10] =>     [81] => 2 Dunwood Park Court Shaw NCHA/CH     [fridayam1] => 2 Dunwood Park Court Shaw NCHA/CH     [82] =>     [fridayam2] =>     [83] =>     [fridayam3] =>     [84] =>     [fridayam4] =>     [85] =>     [fridayam5] =>     [86] =>     [fridayam6] =>     [87] =>     [fridayam7] =>     [88] =>     [fridayam8] =>     [89] =>     [fridayam9] =>     [90] =>     [fridayam10] =>     [91] => 1 Birch Court Heywood NCHA/CH     [fridaypm1] => 1 Birch Court Heywood NCHA/CH     [92] =>     [fridaypm2] =>     [93] =>     [fridaypm3] =>     [94] =>     [fridaypm4] =>     [95] =>     [fridaypm5] =>     [96] =>     [fridaypm6] =>     [97] =>     [fridaypm7] =>     [98] =>     [fridaypm8] =>     [99] =>     [fridaypm9] =>     [100] =>     [fridaypm10] =>     [101] =>     [saturdayam1] =>     [102] =>     [saturdayam2] =>     [103] =>     [saturdayam3] =>     [104] =>     [saturdayam4] =>     [105] =>     [saturdayam5] =>     [106] =>     [saturdayam6] =>     [107] =>     [saturdayam7] =>     [108] =>     [saturdayam8] =>     [109] =>     [saturdayam9] =>     [110] =>     [saturdayam10] =>     [111] =>     [saturdaypm1] =>     [112] =>     [saturdaypm2] =>     [113] =>     [saturdaypm3] =>     [114] =>     [saturdaypm4] =>     [115] =>     [saturdaypm5] =>     [116] =>     [saturdaypm6] =>     [117] =>     [saturdaypm7] =>     [118] =>     [saturdaypm8] =>     [119] =>     [saturdaypm9] =>     [120] =>     [saturdaypm10] => ) Array (     [0] => 46     [wn] => 46     [1] => 30 St Marys Court Oldham NCHA/CH     [mondayam1] => 30 St Marys Court Oldham NCHA/CH     [2] => 22 Hollybank Court Cheadle Hulme NCHA/RD     [mondayam2] => 22 Hollybank Court Cheadle Hulme NCHA/RD     [3] =>     [mondayam3] =>     [4] =>     [mondayam4] =>     [5] =>     [mondayam5] =>     [6] =>     [mondayam6] =>     [7] =>     [mondayam7] =>     [8] =>     [mondayam8] =>     [9] =>     [mondayam9] =>     [10] =>     [mondayam10] =>     [11] => 18 Wimpole Street Higgenshaw Village NCHA/CH     [mondaypm1] => 18 Wimpole Street Higgenshaw Village NCHA/CH     [12] => 22 Hollybank Court Cheadle Hulme NCHA/RD     [mondaypm2] => 22 Hollybank Court Cheadle Hulme NCHA/RD     [13] =>     [mondaypm3] =>     [14] =>     [mondaypm4] =>     [15] =>     [mondaypm5] =>     [16] =>     [mondaypm6] =>     [17] =>     [mondaypm7] =>     [18] =>     [mondaypm8] =>     [19] =>     [mondaypm9] =>     [20] =>     [mondaypm10] =>     [21] => 10 Ravenside Park Chadderton NCHA/CH     [tuesdayam1] => 10 Ravenside Park Chadderton NCHA/CH     [22] =>     [tuesdayam2] =>     [23] =>     [tuesdayam3] =>     [24] =>     [tuesdayam4] =>     [25] =>     [tuesdayam5] =>     [26] =>     [tuesdayam6] =>     [27] =>     [tuesdayam7] =>     [28] =>     [tuesdayam8] =>     [29] =>     [tuesdayam9] =>     [30] =>     [tuesdayam10] =>     [31] => 37 St Marys Court Oldham NCHA/CH     [tuesdaypm1] => 37 St Marys Court Oldham NCHA/CH     [32] =>     [tuesdaypm2] =>     [33] =>     [tuesdaypm3] =>     [34] =>     [tuesdaypm4] =>     [35] =>     [tuesdaypm5] =>     [36] =>     [tuesdaypm6] =>     [37] =>     [tuesdaypm7] =>     [38] =>     [tuesdaypm8] =>     [39] =>     [tuesdaypm9] =>     [40] =>     [tuesdaypm10] =>     [41] => 28 Wimpole Street Higgenshaw Village NCHA/CH     [wednesdayam1] => 28 Wimpole Street Higgenshaw Village NCHA/CH     [42] =>     [wednesdayam2] =>     [43] =>     [wednesdayam3] =>     [44] =>     [wednesdayam4] =>     [45] =>     [wednesdayam5] =>     [46] =>     [wednesdayam6] =>     [47] =>     [wednesdayam7] =>     [48] =>     [wednesdayam8] =>     [49] =>     [wednesdayam9] =>     [50] =>     [wednesdayam10] =>     [51] => 26 Wimpole Street Higgenshaw Village NCHA/CH     [wednesdaypm1] => 26 Wimpole Street Higgenshaw Village NCHA/CH     [52] =>     [wednesdaypm2] =>     [53] =>     [wednesdaypm3] =>     [54] =>     [wednesdaypm4] =>     [55] =>     [wednesdaypm5] =>     [56] =>     [wednesdaypm6] =>     [57] =>     [wednesdaypm7] =>     [58] =>     [wednesdaypm8] =>     [59] =>     [wednesdaypm9] =>     [60] =>     [wednesdaypm10] =>     [61] =>     [thursdayam1] =>     [62] =>     [thursdayam2] =>     [63] =>     [thursdayam3] =>     [64] =>     [thursdayam4] =>     [65] =>     [thursdayam5] =>     [66] =>     [thursdayam6] =>     [67] =>     [thursdayam7] =>     [68] =>     [thursdayam8] =>     [69] =>     [thursdayam9] =>     [70] =>     [thursdayam10] =>     [71] =>     [thursdaypm1] =>     [72] =>     [thursdaypm2] =>     [73] =>     [thursdaypm3] =>     [74] =>     [thursdaypm4] =>     [75] =>     [thursdaypm5] =>     [76] =>     [thursdaypm6] =>     [77] =>     [thursdaypm7] =>     [78] =>     [thursdaypm8] =>     [79] =>     [thursdaypm9] =>     [80] =>     [thursdaypm10] =>     [81] =>     [fridayam1] =>     [82] =>     [fridayam2] =>     [83] =>     [fridayam3] =>     [84] =>     [fridayam4] =>     [85] =>     [fridayam5] =>     [86] =>     [fridayam6] =>     [87] =>     [fridayam7] =>     [88] =>     [fridayam8] =>     [89] =>     [fridayam9] =>     [90] =>     [fridayam10] =>     [91] =>     [fridaypm1] =>     [92] =>     [fridaypm2] =>     [93] =>     [fridaypm3] =>     [94] =>     [fridaypm4] =>     [95] =>     [fridaypm5] =>     [96] =>     [fridaypm6] =>     [97] =>     [fridaypm7] =>     [98] =>     [fridaypm8] =>     [99] =>     [fridaypm9] =>     [100] =>     [fridaypm10] =>     [101] =>     [saturdayam1] =>     [102] =>     [saturdayam2] =>     [103] =>     [saturdayam3] =>     [104] =>     [saturdayam4] =>     [105] =>     [saturdayam5] =>     [106] =>     [saturdayam6] =>     [107] =>     [saturdayam7] =>     [108] =>     [saturdayam8] =>     [109] =>     [saturdayam9] =>     [110] =>     [saturdayam10] =>     [111] =>     [saturdaypm1] =>     [112] =>     [saturdaypm2] =>     [113] =>     [saturdaypm3] =>     [114] =>     [saturdaypm4] =>     [115] =>     [saturdaypm5] =>     [116] =>     [saturdaypm6] =>     [117] =>     [saturdaypm7] =>     [118] =>     [saturdaypm8] =>     [119] =>     [saturdaypm9] =>     [120] =>     [saturdaypm10] => )
  2. thanks for that was a great help, learnt alot from looking at that. only thing i dont really get it this bit [code]<?php   $all = ''; // What we'll dump at the end   // Do for am   for($i = 1; $i <= 10; $i++){     $skip = false;     $row = '<tr><td>a.m</td>';     foreach($days as $day){ // $days was set above       $val = ${$day . 'am' . $i};       if(!strlen($val)){         $skip = true; // flag outer loop to skip this row         break;       }else{         $row .= '<td align="center">&nbsp;' . $val . '</td>';       }     }     if(!$skip){       // If we don't want to skip, append to $all       $all .= $row . '</tr>';     }   }   // Do for pm   for($i = 1; $i <= 10; $i++){     $skip = false;     $row = '<tr><td>p.m</td>';     foreach($days as $day){ // $days was set above       $val = ${$day . 'pm' . $i};       if(!strlen($val)){         $skip = true; // flag outer loop to skip this row         break;       }else{         $row .= '<td align="center">&nbsp;' . $val . '</td>';       }     }     if(!$skip){       // If we don't want to skip, append to $all       $all .= $row . '</tr>';     }   }   echo $all; ?>[/code] the code only shows the first row of the first table when i use the code u just made any ideas y?
  3. i have just put the if statement on mondaypm7 tuesdaypm7 to test it, i want this to be implimented on all the time slots
  4. i will post the whole code and you will see and maybe get a better picture of what im trying to achieve [code=php:0]<!-- Page Code --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>City Response.com | Installation | Electrical Installation</title> <? include "../../includes/meta.php"; ?> </head> <body> <? include "../db.php"; $thisweek = date("W"); $nextweek = $thisweek + '1'; $weekafter = $thisweek + '2'; $sql = mysql_query("SELECT * FROM electrical WHERE wn = '$thisweek' OR (wn = '$nextweek') OR (wn = '$weekafter') "); while($row = mysql_fetch_array($sql)){ $mondayam1 = $row["mondayam1"]; $mondayam2 = $row["mondayam2"]; $mondayam3 = $row["mondayam3"]; $mondayam4 = $row["mondayam4"]; $mondayam5 = $row["mondayam5"]; $mondayam6 = $row["mondayam6"]; $mondayam7 = $row["mondayam7"]; $mondayam8 = $row["mondayam8"]; $mondayam9 = $row["mondayam9"]; $mondayam10 = $row["mondayam10"]; $mondaypm1 = $row["mondaypm1"]; $mondaypm2 = $row["mondaypm2"]; $mondaypm3 = $row["mondaypm3"]; $mondaypm4 = $row["mondaypm4"]; $mondaypm5 = $row["mondaypm5"]; $mondaypm6 = $row["mondaypm6"]; $mondaypm7 = $row["mondaypm7"]; $mondaypm8 = $row["mondaypm8"]; $mondaypm9 = $row["mondaypm9"]; $mondaypm10 = $row["mondaypm10"]; $tuesdayam1 = $row["tuesdayam1"]; $tuesdayam2 = $row["tuesdayam2"]; $tuesdayam3 = $row["tuesdayam3"]; $tuesdayam4 = $row["tuesdayam4"]; $tuesdayam5 = $row["tuesdayam5"]; $tuesdayam6 = $row["tuesdayam6"]; $tuesdayam7 = $row["tuesdayam7"]; $tuesdayam8 = $row["tuesdayam8"]; $tuesdayam9 = $row["tuesdayam9"]; $tuesdayam10 = $row["tuesdayam10"]; $tuesdaypm1 = $row["tuesdaypm1"]; $tuesdaypm2 = $row["tuesdaypm2"]; $tuesdaypm3 = $row["tuesdaypm3"]; $tuesdaypm4 = $row["tuesdaypm4"]; $tuesdaypm5 = $row["tuesdaypm5"]; $tuesdaypm6 = $row["tuesdaypm6"]; $tuesdaypm7 = $row["tuesdaypm7"]; $tuesdaypm8 = $row["tuesdaypm8"]; $tuesdaypm9 = $row["tuesdaypm9"]; $tuesdaypm10 = $row["tuesdaypm10"]; $wednesdayam1 = $row["wednesdayam1"]; $wednesdayam2 = $row["wednesdayam2"]; $wednesdayam3 = $row["wednesdayam3"]; $wednesdayam4 = $row["wednesdayam4"]; $wednesdayam5 = $row["wednesdayam5"]; $wednesdayam6 = $row["wednesdayam6"]; $wednesdayam7 = $row["wednesdayam7"]; $wednesdayam8 = $row["wednesdayam8"]; $wednesdayam9 = $row["wednesdayam9"]; $wednesdayam10 = $row["wednesdayam10"]; $wednesdaypm1 = $row["wednesdaypm1"]; $wednesdaypm2 = $row["wednesdaypm2"]; $wednesdaypm3 = $row["wednesdaypm3"]; $wednesdaypm4 = $row["wednesdaypm4"]; $wednesdaypm5 = $row["wednesdaypm5"]; $wednesdaypm6 = $row["wednesdaypm6"]; $wednesdaypm7 = $row["wednesdaypm7"]; $wednesdaypm8 = $row["wednesdaypm8"]; $wednesdaypm9 = $row["wednesdaypm9"]; $wednesdaypm10 = $row["wednesdaypm10"]; $thursdayam1 = $row["thursdayam1"]; $thursdayam2 = $row["thursdayam2"]; $thursdayam3 = $row["thursdayam3"]; $thursdayam4 = $row["thursdayam4"]; $thursdayam5 = $row["thursdayam5"]; $thursdayam6 = $row["thursdayam6"]; $thursdayam7 = $row["thursdayam7"]; $thursdayam8 = $row["thursdayam8"]; $thursdayam9 = $row["thursdayam9"]; $thursdayam10 = $row["thursdayam10"]; $thursdaypm1 = $row["thursdaypm1"]; $thursdaypm2 = $row["thursdaypm2"]; $thursdaypm3 = $row["thursdaypm3"]; $thursdaypm4 = $row["thursdaypm4"]; $thursdaypm5 = $row["thursdaypm5"]; $thursdaypm6 = $row["thursdaypm6"]; $thursdaypm7 = $row["thursdaypm7"]; $thursdaypm8 = $row["thursdaypm8"]; $thursdaypm9 = $row["thursdaypm9"]; $thursdaypm10 = $row["thursdaypm10"]; $fridayam1 = $row["fridayam1"]; $fridayam2 = $row["fridayam2"]; $fridayam3 = $row["fridayam3"]; $fridayam4 = $row["fridayam4"]; $fridayam5 = $row["fridayam5"]; $fridayam6 = $row["fridayam6"]; $fridayam7 = $row["fridayam7"]; $fridayam8 = $row["fridayam8"]; $fridayam9 = $row["fridayam9"]; $fridayam10 = $row["fridayam10"]; $fridaypm1 = $row["fridaypm1"]; $fridaypm2 = $row["fridaypm2"]; $fridaypm3 = $row["fridaypm3"]; $fridaypm4 = $row["fridaypm4"]; $fridaypm5 = $row["fridaypm5"]; $fridaypm6 = $row["fridaypm6"]; $fridaypm7 = $row["fridaypm7"]; $fridaypm8 = $row["fridaypm8"]; $fridaypm9 = $row["fridaypm9"]; $fridaypm10 = $row["fridaypm10"]; $saturdayam1 = $row["saturdayam1"]; $saturdayam2 = $row["saturdayam2"]; $saturdayam3 = $row["saturdayam3"]; $saturdayam4 = $row["saturdayam4"]; $saturdayam5 = $row["saturdayam5"]; $saturdayam6 = $row["saturdayam6"]; $saturdayam7 = $row["saturdayam7"]; $saturdayam8 = $row["saturdayam8"]; $saturdayam9 = $row["saturdayam9"]; $saturdayam10 = $row["saturdayam10"]; $saturdaypm1 = $row["saturdaypm1"]; $saturdaypm2 = $row["saturdaypm2"]; $saturdaypm3 = $row["saturdaypm3"]; $saturdaypm4 = $row["saturdaypm4"]; $saturdaypm5 = $row["saturdaypm5"]; $saturdaypm6 = $row["saturdaypm6"]; $saturdaypm7 = $row["saturdaypm7"]; $saturdaypm8 = $row["saturdaypm8"]; $saturdaypm9 = $row["saturdaypm9"]; $saturdaypm10 = $row["saturdaypm10"]; $wn = $row["wn"]; ?> <center><b><font size="+3"> <? if ($wn == '44') { echo "Week Commencing 30th October 2006"; } elseif ($wn == '45') { echo "Week Commencing 6th November 2006"; } elseif ($wn == '46') { echo "Week Commencing 13th November 2006"; } elseif ($wn == '47') { echo "Week Commencing 20th November 2006"; } elseif ($wn == '48') { echo "Week Commencing 27th November 2006"; } elseif ($wn == '49') { echo "Week Commencing 4th December 2006"; } elseif ($wn == '50') { echo "Week Commencing 11th December 2006"; } elseif ($wn == '51') { echo "Week Commencing 18th December 2006"; } elseif ($wn == '52') { echo "Week Commencing 25th December 2006"; } elseif ($wn == '1') { echo "Week Commencing 1st January 2007"; } elseif ($wn == '2') { echo "Week Commencing 8th January 2007"; } elseif ($wn == '3') { echo "Week Commencing 15th January 2007"; } elseif ($wn == '4') { echo "Week Commencing 22nd January 2007"; } elseif ($wn == '5') { echo "Week Commencing 29th January 2007"; } ?> </b></font></center> <table width=100% border="1">   <tr>   <td>Time</td>     <td>Monday</td>     <td>Tuesday</td>     <td>Wednesday</td>     <td>Thursday</td>     <td>Friday</td>     <td>Saturday</td>   </tr>   <tr>     <td>a.m</td>     <td align="center">&nbsp;<? echo "$mondayam1"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdayam1"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdayam1"; ?></td>     <td align="center">&nbsp;<? echo "$thursdayam1"; ?></td>     <td align="center">&nbsp;<? echo "$fridayam1"; ?></td>     <td align="center">&nbsp;<? echo "$saturdayam1"; ?></td>   </tr>   <tr>     <td>a.m</td>     <td align="center">&nbsp;<? echo "$mondayam2"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdayam2"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdayam2"; ?></td>     <td align="center">&nbsp;<? echo "$thursdayam2"; ?></td>     <td align="center">&nbsp;<? echo "$fridayam2"; ?></td>     <td align="center">&nbsp;<? echo "$saturdayam2"; ?></td>   </tr>   <tr>     <td>a.m</td>     <td align="center">&nbsp;<? echo "$mondayam3"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdayam3"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdayam3"; ?></td>     <td align="center">&nbsp;<? echo "$thursdayam3"; ?></td>     <td align="center">&nbsp;<? echo "$fridayam3"; ?></td>     <td align="center">&nbsp;<? echo "$saturdayam3"; ?></td>   </tr>   <tr>     <td>a.m</td>     <td align="center">&nbsp;<? echo "$mondayam4"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdayam4"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdayam4"; ?></td>     <td align="center">&nbsp;<? echo "$thursdayam4"; ?></td>     <td align="center">&nbsp;<? echo "$fridayam4"; ?></td>     <td align="center">&nbsp;<? echo "$saturdayam4"; ?></td>   </tr>   <tr>     <td>a.m</td>     <td align="center">&nbsp;<? echo "$mondayam5"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdayam5"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdayam5"; ?></td>     <td align="center">&nbsp;<? echo "$thursdayam5"; ?></td>     <td align="center">&nbsp;<? echo "$fridayam5"; ?></td>     <td align="center">&nbsp;<? echo "$saturdayam5"; ?></td>   </tr>   <tr>     <td>a.m</td>     <td align="center">&nbsp;<? echo "$mondayam6"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdayam6"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdayam6"; ?></td>     <td align="center">&nbsp;<? echo "$thursdayam6"; ?></td>     <td align="center">&nbsp;<? echo "$fridayam6"; ?></td>     <td align="center">&nbsp;<? echo "$saturdayam6"; ?></td>   </tr>   <tr>     <td>a.m</td>     <td align="center">&nbsp;<? echo "$mondayam7"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdayam7"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdayam7"; ?></td>     <td align="center">&nbsp;<? echo "$thursdayam7"; ?></td>     <td align="center">&nbsp;<? echo "$fridayam7"; ?></td>     <td align="center">&nbsp;<? echo "$saturdayam7"; ?></td>   </tr>   <tr>     <td>a.m</td>     <td align="center">&nbsp;<? echo "$mondayam8"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdayam8"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdayam8"; ?></td>     <td align="center">&nbsp;<? echo "$thursdayam8"; ?></td>     <td align="center">&nbsp;<? echo "$fridayam8"; ?></td>     <td align="center">&nbsp;<? echo "$saturdayam8"; ?></td>   </tr>   <tr>     <td>a.m</td>     <td align="center">&nbsp;<? echo "$mondayam9"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdayam9"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdayam9"; ?></td>     <td align="center">&nbsp;<? echo "$thursdayam9"; ?></td>     <td align="center">&nbsp;<? echo "$fridayam9"; ?></td>     <td align="center">&nbsp;<? echo "$saturdayam9"; ?></td>   </tr>   <tr>     <td>a.m</td>     <td align="center">&nbsp;<? echo "$mondayam10"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdayam10"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdayam10"; ?></td>     <td align="center">&nbsp;<? echo "$thursdayam10"; ?></td>     <td align="center">&nbsp;<? echo "$fridayam10"; ?></td>     <td align="center">&nbsp;<? echo "$saturdayam10"; ?></td>   </tr>   <tr>     <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td>    <td>&nbsp;</td>   </tr>     <td>p.m</td>     <td align="center"><? echo "$mondaypm1"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdaypm1"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdaypm1"; ?></td>     <td align="center">&nbsp;<? echo "$thursdaypm1"; ?></td>     <td align="center">&nbsp;<? echo "$fridaypm1"; ?></td>     <td align="center">&nbsp;<? echo "$saturdaypm1"; ?></td>   </tr>   <tr>     <td>p.m</td>     <td align="center">&nbsp;<? echo "$mondaypm2"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdaypm2"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdaypm2"; ?></td>     <td align="center">&nbsp;<? echo "$thursdaypm2"; ?></td>     <td align="center">&nbsp;<? echo "$fridaypm2"; ?></td>     <td align="center">&nbsp;<? echo "$saturdaypm2"; ?></td>   </tr>   <tr>     <td>p.m</td>     <td align="center">&nbsp;<? echo "$mondaypm3"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdaypm3"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdaypm3"; ?></td>     <td align="center">&nbsp;<? echo "$thursdaypm3"; ?></td>     <td align="center">&nbsp;<? echo "$fridaypm3"; ?></td>     <td align="center">&nbsp;<? echo "$saturdaypm3"; ?></td>   </tr>   <tr>     <td>p.m</td>     <td align="center">&nbsp;<? echo "$mondaypm4"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdaypm4"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdaypm4"; ?></td>     <td align="center">&nbsp;<? echo "$thursdaypm4"; ?></td>     <td align="center">&nbsp;<? echo "$fridaypm4"; ?></td>     <td align="center">&nbsp;<? echo "$saturdaypm4"; ?></td>   </tr>   <tr>     <td>p.m</td>     <td align="center">&nbsp;<? echo "$mondaypm5"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdaypm5"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdaypm5"; ?></td>     <td align="center">&nbsp;<? echo "$thursdaypm5"; ?></td>     <td align="center">&nbsp;<? echo "$fridaypm5"; ?></td>     <td align="center">&nbsp;<? echo "$saturdaypm5"; ?></td>   </tr>   <tr>     <td>p.m</td>     <td align="center">&nbsp;<? echo "$mondaypm6"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdaypm6"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdaypm6"; ?></td>     <td align="center">&nbsp;<? echo "$thursdaypm6"; ?></td>     <td align="center">&nbsp;<? echo "$fridaypm6"; ?></td>     <td align="center">&nbsp;<? echo "$saturdaypm6"; ?></td>   </tr>     <? if($monday7 == '' && $tuesday7 == '' && $wednesdaypm7 == '' && $thursdaypm7 == '' && $fridaypm7 == '' && $saturdaypm7 == '') { echo"$mondaypm7"; } else{ ?>   <tr>     <td>p.m</td>     <td align="center">&nbsp;<? echo "$mondaypm7"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdaypm7"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdaypm7"; ?></td>     <td align="center">&nbsp;<? echo "$thursdaypm7"; ?></td>     <td align="center">&nbsp;<? echo "$fridaypm7"; ?></td>     <td align="center">&nbsp;<? echo "$saturdaypm7"; ?></td>   </tr> <? } ?>   <tr>     <td>p.m</td>     <td align="center">&nbsp;<? echo "$mondaypm8"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdaypm8"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdaypm8"; ?></td>     <td align="center">&nbsp;<? echo "$thursdaypm8"; ?></td>     <td align="center">&nbsp;<? echo "$fridaypm8"; ?></td>     <td align="center">&nbsp;<? echo "$saturdaypm8"; ?></td>   </tr>   <tr>     <td>p.m</td>     <td align="center">&nbsp;<? echo "$mondaypm9"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdaypm9"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdaypm9"; ?></td>     <td align="center">&nbsp;<? echo "$thursdaypm9"; ?></td>     <td align="center">&nbsp;<? echo "$fridaypm9"; ?></td>     <td align="center">&nbsp;<? echo "$saturdaypm9"; ?></td>   </tr>   <tr>     <td>p.m</td>     <td align="center">&nbsp;<? echo "$mondaypm10"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdaypm10"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdaypm10"; ?></td>     <td align="center">&nbsp;<? echo "$thursdaypm10"; ?></td>     <td align="center">&nbsp;<? echo "$fridaypm10"; ?></td>     <td align="center">&nbsp;<? echo "$saturdaypm10"; ?></td>   </tr> </table> <br /> <? } ?> </body> </html> <!-- Page Code --> [/code]
  5. They are being creating from the database in some code above this part of the script. they are all being retreived successfully. i think its definatly a problem with the if statment.  :(
  6. tried both, just havnt changed em back, that still didnt work
  7. im making this table structure and i need it to not show a row if there is no data in any of the rows: [code=php:0]<table width=100% border="1">   <tr>   <td>Time</td>     <td>Monday</td>     <td>Tuesday</td>     <td>Wednesday</td>     <td>Thursday</td>     <td>Friday</td>     <td>Saturday</td>   </tr> <? if($monday7 = '' && $tuesday7 = '' && $wednesdaypm7 = '' && $thursdaypm7 = '' && $fridaypm7 = '' && $saturdaypm7 = '') {  } else{ ?>   <tr>     <td>p.m</td>     <td align="center">&nbsp;<? echo "$mondaypm7"; ?></td>     <td align="center">&nbsp;<? echo "$tuesdaypm7"; ?></td>     <td align="center">&nbsp;<? echo "$wednesdaypm7"; ?></td>     <td align="center">&nbsp;<? echo "$thursdaypm7"; ?></td>     <td align="center">&nbsp;<? echo "$fridaypm7"; ?></td>     <td align="center">&nbsp;<? echo "$saturdaypm7"; ?></td>   </tr> <? } ?> [/code] thats what i have but it dosnt do as its told, if there is data it still hides it, have i done somethin wrong here? any help would be great!
  8. Mjlogan Yours a star, iv been staring at that for hours looking for duplicates or missing one. thank you so much mate!
  9. im using [code]srand((double)microtime()*1000000);  $id1 =  rand(1000,9999); srand((double)microtime()*1000000);  $id2 =  rand(1000,9999); $id = $id1 . $id2; $id = md5($id);[/code] to make the id.
  10. when i submit my data i get this error - "column count does not match value at line 1" i have tried everything and it still doesnt work someone please help me its really winding me up! [code]$sql = "INSERT INTO appform (id, q1, q1a, q2, q2a, q2b, q2c, q3, q3a, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, q21, q22, q23, q24, q25, q26, q27, q28, q29, q30, q31, q32, q32a, q33, q34, q35, q36, q37, q38, q39, q40, q41, q42, q43, q44, q45, q46, q47, q48, q49, q50, q51, q52, q53, q54, q55, q56, q57, q58, q59, q60, q61, q62, q63, q64, q65, q66, q67, q68, q69, q70, q71, q72, q73, q74, q75, q76, q77, q78, q79, q80, q81, q82, q83, q84, q85, q86, q87, q88, q89, q90, q91, q92, q93, q94, q95, q96, q97, q98, q99, q100, q101) VALUES ('id', '$q1', '$q1a', '$q2', '$q2a', '$q2b', '$q2c', '$q3', '$q3a', '$q4', '$q5', '$q6', '$q7', '$q8', '$q9', '$q10', '$q11', '$q12', '$q13', '$q14', '$q15', '$q16', '$q17', '$q18', '$q19', '$q20', '$q21', '$q22', '$q23', '$q24', '$q25', '$q26', '$q27', '$q28', '$q29', '$q30', '$q31', '$q32', '$q32a', '$q33', '$q34', '$q35', '$q36', '$q37', '$q38', '$q39', '$q40', '$q41', '$q42', '$q43', '$q44', '$q45', '$q46', '$q47', '$q48', '$q49', '$q50', '$q51', '$q52', '$q53', '$q54', '$q55', '$q56', '$q57', '$q58', '$q59', '$q60', '$q61', '$q62', '$q63', '$q64', '$q65', '$q66', '$q67', '$q68', '$q69', '$q70', '$q71', '$q72', '$q73', '$q74', '$q75', '$q76', '$q77', '$q78', '$q79', '$q80', '$q81', '$q82', '$q83', '$q84', '$q85', '$q86', '$q87', '$q88', '$q89', '$q90', '$q91', '$q92', '$q92', '$q93', '$q94', '$q95', '$q96', '$q97', '$q98', '$q99', '$q100', '$q101')"; $query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error()); echo "<center>Application Sent<center>";[/code]
  11. i posted the whole code above, there is a where clause and ending " andy
  12. Im A newb aswell but it looks like you aint set your variables up right and the form is going to a page that dosnt exist because you havnt set $choise to anything, also your coding html in php wrong for a line of html like wat you have there you need echo"<td><input type=\'radio\' name=\'select\' value=\'b\'></td>"; think its best if you start again and look for examples on the net
  13. i have created this script which i want to use to update the database. but it dosnt work. it says that it has updated the database but nothing changes. i am aware that this looks like an sql problem and maybe should be posted there, but i wreckon its a php problem. heres the code: [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Koru | Admin | Edit a Product</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="header"></div> <div id="bar">Koru - Admin Panel - Edit A Product</div> <div id="content"> <? include "db.php"; $id = $_REQUEST['id']; $submit = $_POST['Submit']; if($submit) { $code = ($_POST['code']); $type = ($_POST['type']); $collection = ($_POST['collection']); $price = ($_POST['price']); $imagefull = ($_POST['imagefull']); $imagethumb = ($_POST['imagethumb']); $description = ($_POST['description']); $item_level = ($_POST['item_level']); $sql = "UPDATE koruproduct SET code = '$code',  type = '$type', collection = '$collection', price = '$price', imagefull = '$imagefull', imagethumb = '$imagethumb', description = '$description', item_level = '$item_level' WHERE id = '$id' "; $query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error()); echo "<center>Database Updated<br><a href=\"index.php\">Go Back</a><center>"; } else {  $sql = mysql_query("SELECT * FROM koruproduct WHERE id = '$id'"); while($ex = mysql_fetch_array($sql)){     // Build your formatted results here. $id = $ex["id"]; $code = $ex["code"]; $type = $ex["type"]; $collection = $ex["collection"]; $price = $ex["price"]; $imagefull = $ex["imagefull"]; $imagethumb = $ex["imagethumb"]; $description = $ex["description"]; $item_level = $ex["item_level"]; $return = $ex["return"]; } ?> <form name="edit" method="post" action="<?php echo $PHP_SELF; ?>"> <p>To Edit Simply Modify The Form and Hit Submit!:</p> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="117"><font size="1">Product Code*: </font> </td> <td width="577"> <font size="1"> <input type="text" name="code" size="50" value="<? echo"$code";?>"> </font> </td> </tr> <tr> <td width="117"><font size="1">Product Type*:</font></td> <td width="577"> <font size="1"> <select name="type"> <? if ($type == 'Earrings'){ echo"<option selected=\"selected\" value=\"Earrings\">Earrings</option>"; echo"<option value=\"Bracelet\">Bracelet</option>"; echo"<option value=\"Necklace\">Necklace</option>"; } elseif ($type == 'Bracelet') { echo"<option selected=\"selected\" value=\"Bracelet\">Bracelet</option>"; echo"<option value=\"Earrings\">Earrings</option>"; echo"<option value=\"Necklace\">Necklace</option>"; } elseif ($type == 'Necklace') { echo"<option selected=\"selected\" value=\"Necklace\">Necklace</option>"; echo"<option value=\"Earrings\">Earrings</option>"; echo"<option value=\"Bracelet\">Bracelet</option>"; } ?>   </select> </font> </td> </tr> <tr> <td width="117"><font size="1">Collection*:</font></td> <td width="577"> <font size="1"> <select name="collection"> <? if ($collection == 'ethnicchic'){ echo"<option selected=\"selected\" value=\"ethnicchic\">Ethnic Chic</option>"; echo"<option value=\"contemporarycreations\">Contemporary Creations</option>"; echo"<option value=\"indiansummer\">Indian Summer</option>"; echo"<option value=\"africaninspirations\">African Inspirations</option>"; } elseif ($collection == 'contemporarycreations') { echo"<option selected=\"selected\" value=\"contemporarycreations\">Contemporary Creations</option>"; echo"<option value=\"indiansummer\">Indian Summer</option>"; echo"<option value=\"africaninspirations\">African Inspirations</option>"; echo"<option value=\"ethnicchic\">Ethnic Chic</option>"; } elseif ($collection == 'indiansummer') { echo"<option value=\"contemporarycreations\">Contemporary Creations</option>"; echo"<option selected=\"selected\" value=\"indiansummer\">Indian Summer</option>"; echo"<option value=\"africaninspirations\">African Inspirations</option>"; echo"<option value=\"ethnicchic\">Ethnic Chic</option>"; } elseif ($collection == 'africaninspirations') { echo"<option value=\"contemporarycreations\">Contemporary Creations</option>"; echo"<option value=\"indiansummer\">Indian Summer</option>"; echo"<option selected=\"selected\" value=\"africaninspirations\">African Inspirations</option>"; echo"<option value=\"ethnicchic\">Ethnic Chic</option>"; } ?>   </select></font> </td> </tr> <tr> <td width="117"><font size="1">Price*(excluding &pound; sign e.g 16.50):</font></td> <td width="577"> <font size="1"> <input type="text" name="price" size="20" value="<? echo"$price";?>"> </font> </td> </tr> <td width="117"><font size="1">Image Full*:</font></td> <td width="577"> <font size="1"> <input type="text" name="imagefull" size="50" value="<? echo"$imagefull";?>"> </font> </td> </tr> <td width="117"><font size="1">Image Thumbnail*:</font></td> <td width="577"> <font size="1"> <input type="text" name="imagethumb" size="50" value="<? echo"$imagethumb";?>"> </font> </td> </tr> <td width="117"><font size="1">Description*:</font></td> <td width="577"> <font size="1"> <textarea name="description" cols="50" rows="6"><? echo"$description";?></textarea> </font> </td> </tr> <td width="117"><font size="1">Tick box if item is out of stock*:</font></td> <td width="577"> <font size="1"> <? if ($item_level == '0'){ ?> <input type="checkbox" name="item_level" value="0" /> <? } elseif ($item_level == '1'){ ?> <input name="item_level" type="checkbox" value="1" checked="checked" /> <? } ?> </font> </td> </tr> </table> <p> <font size="1"> <input type="submit" name="Submit" value="Submit"></font> </p> </form> <?php }//end this function ?> </div> </body> </html> [/code] Any Help Is very much appriciated thanks andy  ;)
  14. Your a star mate, it was staring me right in the face. Much Appriceated!
  15. Before anyone says it, iv tried searchin the forum to see if i can work out why my script isnt working, but had no luck. its a simple one anyway: im trying to delete records from my db using this code: [code] <? include "connect.php"; $id = $_REQUEST['id']; $query = "DELETE FROM gallery WHERE id = '$id'"; $query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error()); echo "Database Updated."; ?> [/code] I get the error: Cannot query the database. Query was empty anyone know where im going wrong? :)
  16. Thanks for that, i wasnt sure what it was called. i tried the tutorial and it still isnt working. here is my code: [code] <?php include 'connect.php';     $limit          = 5;                   $query_count    = "SELECT count(*) FROM gallery";         $result_count   = @mysql_query($query_count);         $totalrows      = @mysql_num_rows($result_count);     if(empty($page)){         $page = 1;     }              $limitvalue = $page * $limit - ($limit);     $query  = "SELECT * FROM gallery LIMIT $limitvalue, $limit";             $result = mysql_query($query) or die("Error: " . mysql_error()); while ($row = mysql_fetch_assoc($result)) { $id = $row["id"]; $name = $row["name"]; $des = $row["des"]; $alt = $row["alt"]; $src = $row["src"]; $date = $row["date"]; }     if(mysql_num_rows($result) == 0){         echo("Nothing to Display!");     }     $bgcolor = "#E0E0E0"; // light gray     echo("<table>");          while($row = mysql_fetch_array($result)){         if ($bgcolor == "#E0E0E0"){             $bgcolor = "#FFFFFF";         }else{             $bgcolor = "#E0E0E0";         }     echo("<tr bgcolor=".$bgcolor.">n<td>");     echo"$name";     echo("</td>n<td>");     echo"<img src=thumbs/$src>";     echo("</td>n</tr>");     }     echo("</table>");     if($page != 1){         $pageprev = $page--;                  echo("<a href=\"$PHP_SELF&page=$pageprev\">PREV".$limit."</a> ");     }else{         echo("PREV".$limit." ");     }     $numofpages = $totalrows / $limit;          for($i = 1; $i <= $numofpages; $i++){         if($i == $page){             echo($i." ");         }else{             echo("<a href=\"$PHP_SELF?page=$i\">$i</a> ");         }     }     if(($totalrows % $limit) != 0){         if($i == $page){             echo($i." ");         }else{             echo("<a href=\"$PHP_SELF?page=$i\">$i</a> ");         }     }     if(($totalrows - ($limit * $page)) > 0){         $pagenext = $page++;                  echo("<a href=\"$PHP_SELF?page=$pagenext\">NEXT".$limit."</a>");     }else{         echo("NEXT".$limit);     }          mysql_free_result($result); ?> [/code] Any ideas :'(
  17. I am trying to make a simple gallery. but i want to have pages for it.so that say only ten images show up on a page and then there are links to the next page or previous page. iv looked at some tutorials on the net and cant really get them to work. here is my code: [code] <?php include 'connect.php'; $sql = "SELECT *        FROM  gallery"; $result = mysql_query($sql); if (!$result) {    echo "Could not successfully run query ($sql) from DB: " . mysql_error();    exit; } if (mysql_num_rows($result) == 0) {    echo "No rows found";    exit; } while ($row = mysql_fetch_assoc($result)) { $id = $row["id"]; $name = $row["name"]; $des = $row["des"]; $alt = $row["alt"]; $src = $row["src"]; $date = $row["date"]; } mysql_free_result($result); ?> [/code] anyone able to help me?
  18. this is my code [code] <?php mysql_connect("localhost","********","***********");      //select which database you want to edit mysql_select_db("grange"); $result = @mysql_query("select * from gallery"); while($r=@mysql_fetch_array($result)) {           $id=$r["id"];    $name=$r["name"];    $who=$r["src"];       echo "$id <br> $name <br> $src "; } ?> [/code] Nothing is showing up at all, no errors. when i remove the "@"s then i start getting errors like: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/chuddyuk/public_html/grange/gallery/index.php on line 12 but i cant understand this. ive done this loads of times and its worked. anyone know y nothing shows up now? any help is much appriciated!!!
  19. Thanks alot that worked well good for me!!!!:):)
  20. Im trying to replace data from the database with different words: [code] if ($collection = 'ethnicchic'){ echo "Ethnic Chic"; } elseif ($collection = 'indiansummer'){ echo "Indian Summer"; } elseif ($collection = 'africaninspirations'){ echo "African Inspirations"; } elseif ($collection = 'contemporarycreations'){ echo "Contemporary Creations"; } [/code] i am using the above code to try and change whats in the databse to something else, in this case to put a space betweeen my letters. but it doesnt change anything. any ideas?
  21. Hi - any help is much appriecated. here is my problem:- i need to change Indiansummer to indian summer. the values in my databse dosnt have spaces inbetween so that i can return them onto the site easily, but i need them to show up as 2 words. I havnt posted any code because it wouldnt be relevant to my question. i probably havnt explained this corerctly so if you need to know anythin else please ask :)
  22. ok - sorry here is wat im trying amonst other things [code] <?     $username = "andrew";     $password = "andrew";     if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {?>     <h1>Login</h1><form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">         <p><label for="txtUsername">Username:</label>         <br/><input type="text" title="Enter your Username" name="txtUsername" /></p>       <p><label for="txtpassword">Password:</label>           <br /><input type="password" title="Enter your password" name="txtPassword" /></p>          <p><input type="submit" name="Submit" value="Login" /></p></form><?php }else {      echo"page stufff here?"; ?>[/code]
  23. This is doin my head in really badly. anyone got any ideas at all? please!!!!!!!!
  24. i have a script i have been having problems password protecting, it dosnt need to be a really secure login at all. Here is the code: [code] <html>     <head><title>Questionnaire</title></head>     <body> <?php // Set Emails $to  = 'chuddyuk@gmail.com' . ', '; // note the comma // $to .= 'mamorris62@hotmail.com'; //Set Subject Of Email $subject ="Synergy Questionnaire Response"; // Handle POST method set ALL :( variables         if ($_POST)         {                 $today = date("d-m-Y");             $name = $_POST['name'];             $company = $_POST['company'];             $department = $_POST['department'];             $comments = $_POST['comments'];             $qone = $_POST['qone'];             $qtwo = $_POST['qtwo'];             $qthree = $_POST['qthree'];             $qfour= $_POST['qfour'];             $qfive = $_POST['qfive'];             $qsix = $_POST['qsix'];             $qseven = $_POST['qseven'];             $qeight = $_POST['qeight'];             $qnine = $_POST['qnine'];             $qten = $_POST['qten'];             $qeleven = $_POST['qeleven'];             $qtwelve = $_POST['qtwelve'];             $qthirteen = $_POST['qthirteen'];             $qfourteen = $_POST['qfourteen'];             $qfifteen = $_POST['qfifteen'];             $qsixteen = $_POST['qsixteen'];             $qseventeen = $_POST['qseventeen'];             $qeightteen = $_POST['qeightteen'];             $qnineteen = $_POST['qnineteen'];             $qtwenty = $_POST['qtwenty'];             $qtwentyone = $_POST['qtwentyone'];             $qtwentytwo = $_POST['qtwentytwo'];             $qtwentythree = $_POST['qtwentythree'];             $qtwentyfour = $_POST['qtwentyfour'];             $qtwentyfive = $_POST['qtwentyfive'];             $qtwentysix = $_POST['qtwentysix'];             $qtwentyseven = $_POST['qtwentyseven'];             $qtwentyeight = $_POST['qtwentyeight'];             $qtwentynine = $_POST['qtwentynine'];             $qthirty = $_POST['qthirty'];             $qthirtyone = $_POST['qthirtyone'];             $qthirtytwo = $_POST['qthirtytwo'];             $qthirtythree = $_POST['qthirtythree'];             $qthirtyfour = $_POST['qthirtyfour'];             $qthirtyfive = $_POST['qthirtyfive'];             $qthirtysix = $_POST['qthirtysix'];             $qthirtyseven = $_POST['qthirtyseven'];             $qthirtyeight = $_POST['qthirtyeight'];             $qthirtynine = $_POST['qthirtynine'];             $qfourty = $_POST['qfourty'];             $qfourtyone = $_POST['qfourtyone'];             $qfourtytwo = $_POST['qfourtytwo'];             $qfourtythree = $_POST['qfourtythree'];             $qfourtyfour = $_POST['qfourtyfour'];             $qfourtyfive = $_POST['qfourtyfive'];             $qfourtysix = $_POST['qfourtysix'];             $qfourtyseven = $_POST['qfourtyseven'];             $qfourtyeight = $_POST['qfourtyeight'];             $qfourtynine = $_POST['qfourtynine'];             $qfifty = $_POST['qfifty'];             $qfiftyone = $_POST['qfiftyone'];             $qfiftytwo = $_POST['qfiftytwo'];             $qfiftythree = $_POST['qfiftythree'];              // message (how its appears in the email) $message = " <h1>Questionnaire Results</h1> <p>   Name: $name<br>   Company : $company<br>   Department: $department<br>   Date Submitted: $today </p> <hr> <br> Parts 1-6 use the scale below: <table width=600 border=1>   <tr>     <td bgcolor=#00CCFF><div align=center><strong>1</strong></div></td>     <td bgcolor=#0099FF><div align=center><strong>2</strong></div></td>     <td bgcolor=#0066FF><div align=center><strong>3</strong></div></td>     <td bgcolor=#0033FF><div align=center><strong>4</strong></div></td>     <td bgcolor=#0000FF><div align=center><strong>5</strong></div></td>     <td bgcolor=#0000CC><div align=center><strong>6</strong></div></td>   </tr>   <tr>     <td><div align=center>Very definitely not a source of pressure</div></td>     <td><div align=center>Mostly not a source of pressure</div></td>     <td><div align=center>Generally is not a source of pressure</div></td>     <td><div align=center>Generally is a source of pressure</div></td>     <td><div align=center>Mostly is a source of pressure</div></td>     <td><div align=center>Most definitely a source of pressure</div></td>   </tr> </table> <h3>(1)Relationships</h3> <br> 1) Relationships  with colleagues in my immediate workgroup: $qone <br> 2) Relationships with colleagues in other parts of the organisation: $qtwo <br> 3) Relationships with people outside the organisation (e.g. customers): $qthree <br> 4) Relationships with my immediate supervisor: $qfour <br><br> <h3>(2)Work Demands</h3> <br> 1)The amount of work I have to do: $qfive <br> 2) The pace at which I need to work: $qsix <br> 3) Attending meetings: $qseven <br> 4) Dealing with correspondence (e.g. telephone calls, letter writing or emails): $qeight <br> 5) Getting things done on time (e.g. meeting deadlines): $qnine <br> 6) The environmental conditions in which I work: $qten <br><br> <h3>(3)Culture and Change</h3> <br> 1) Lack of consultation when any organisational changes or planned changes are taking place: $qeleven <br> 2) The systems and procedures in place to get things done in my job: $qtwelve <br> 3) The amount of change that affects the way I do my work: $qthirteen <br> 4) The way change is managed in my workgroup: $qfourteen <br> 5) The processes I have to work with (e.g. systems and standards): $qfifteen <br> 6) The way people interact with each other to get the job done (e.g. teamwork): $qsixteen <br><br> <h3>(4)Role</h3> <br> 1) My role and responsibilities within the organisation: $qseventeen <br> 2) Opportunities to advance within the organisation: $qeightteen <br> 3) Opportunities to develop my job related skills: <b>$qnineteen</b> <br> 4) The amount of positive challenges in my current role (e.g. incentives): $qtwenty <br><br> <h3>(5)Control</h3> <br> 1) Level of control over my work (e.g. workload, self autonomy): $qtwentyone <br> 2) Opportunity to use my own discretion: $qtwentytwo <br> 3) My training needs: $qtwentythree <br> 4) Resources to perform my job: $qtwentyfour <br> 5) Control to schedule my workload (e.g. sequencing): $qtwentyfive <br> 6) The flexibility to manage my time at work: $qtwentysix <br><br> <h3>(6)Personal Factor</h3> <br> 1) Coping with home life responsibilities: $qtwentyseven <br> 2) My work-base knowledge and skills: $qtwentyeight <br> 3) Commuting between work and from home: $qtwentynine <br> 4) Lack of respect from my immediate Manager: $qthirty <br> 5) Lack of respect from colleagues: $qthirtyone <br> 6) Level of experience to perform my job effectively: $qthirtytwo <br><hr><br> Parts 7 and 8 use the scale below: <table width=600 border=1>   <tr>     <td width=10% bgcolor=#00CCFF><div align=center><strong>1</strong></div></td>     <td width=10% bgcolor=#0099FF><div align=center><strong>2</strong></div></td>     <td width=10% bgcolor=#0066FF><div align=center><strong>3</strong></div></td>     <td width=10% bgcolor=#0033FF><div align=center><strong>4</strong></div></td>     <td width=10% bgcolor=#0000FF><div align=center><strong>5</strong></div></td>     <td width=10% bgcolor=#0000CC><div align=center><strong>6</strong></div></td>   </tr>   <tr>     <td><div align=center>Very strongly disagree</div></td>     <td><div align=center>Strongly disagree</div></td>     <td><div align=center>Disagree</div></td>     <td><div align=center>Agree</div></td>     <td><div align=center>Strongly agree</div></td>     <td><div align=center>Very Strongly agree</div></td>   </tr> </table> <br> <h3>(7)Support</h3> <br> 1) I am able to seek help and advice when required from my Manager/Supervisor: $qthirtythree <br> 2) I am able to seek help and advice from my colleagues when /if required: $qthirtyfour <br> 3) Objectives from my immediate Manager are clear: $qthirtyfive <br> 4) I am given adequate feedback from my Manager/Supervisor: $qthirtysix <br> 5) My work is recognised and acknowledged by my Manager/Supervisor: $qthirtyseven <br> 6) I feel confident to freely contact my immediate Manager for support: $qthirtyeight <br><br> <h3>(8)Connection With The Organisation</h3> <br> 1) I am proud to work for this organisation: $qthirtynine <br> 2) I would recommend this organisation as an employer to my friends and family: $qfourty <br> 3) My work adds value to the organisation: $qfourtyone <br> 4) There is a clear link between my work and the organisation’s objectives: $qfourtytwo <br><hr><br> Parts 9-11 use the scale below: <table width=600 border=1>   <tr>     <td width=10% bgcolor=#00CCFF><div align=center><strong>1</strong></div></td>     <td width=10% bgcolor=#0099FF><div align=center><strong>2</strong></div></td>     <td width=10% bgcolor=#0066FF><div align=center><strong>3</strong></div></td>     <td width=10% bgcolor=#0033FF><div align=center><strong>4</strong></div></td>     <td width=10% bgcolor=#0000FF><div align=center><strong>5</strong></div></td>     <td width=10% bgcolor=#0000CC><div align=center><strong>6</strong></div></td>   </tr>   <tr>     <td><div align=center>Never</div></td>     <td><div align=center>Very Rarely</div></td>     <td><div align=center>Occasionally</div></td>     <td><div align=center>Often</div></td>     <td><div align=center>Very Often</div></td>     <td><div align=center>All The Time</div></td>   </tr> </table> <br> <h3>(9)Work Life Balance</h3> <br> 1) I effectively manage the demands of my work, personal and family life: $qfourtythree <br> 2) I find myself doing job related work in my own time (e.g. at home): $qfourtyfour <br> 3) I have the flexibility to meet my work, personal and family commitments: $qfourtyfive <br> 4) The organisation is committed to helping me to balance my work and home life: $qfourtysix <br><br> <h3>(10)Engagement With Work</h3> <br> 1) I am satisfied with the enjoyment I get from work: $qfourtyseven <br> 2) I feel inspired about my work: $qfourtyeight <br> 3) I feel motivated to do my best at work: $qfourtynine <br> 4) I have the necessary resources to do my job effectively: $qfifty <br><br> <h3>(11)Effects Of Pressure</h3> <br> 1) I feel physically or emotionally drained at the end of my working day: $qfiftyone <br> 2) I think about looking for another job: $qfiftytwo <br><hr><br> Part 12 uses the scale below: <table width=600 border=1>   <tr>     <td width=10% bgcolor=#00CCFF><div align=center><strong>1</strong></div></td>     <td width=10% bgcolor=#0099FF><div align=center><strong>2</strong></div></td>     <td width=10% bgcolor=#0066FF><div align=center><strong>3</strong></div></td>     <td width=10% bgcolor=#0033FF><div align=center><strong>4</strong></div></td>     <td width=10% bgcolor=#0000FF><div align=center><strong>5</strong></div></td>   </tr>   <tr>     <td><div align=center>Bored</div></td>     <td><div align=center>Comfortable</div></td>     <td><div align=center>Stretched</div></td>     <td><div align=center>Strained</div></td>     <td><div align=center>Overwhelmed</div></td>   </tr> </table> <br> <h3>(12)Workplace Perceptions</h3> <br> 1) How do you generally feel towards your role?: $qfiftytwo <br> <br> <h3>Comments</h3> <p>$comments</p> "; // Set Email To HTML $headers  = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: Aname <Name@Asite.com>' . "\r\n"; // Send Email!             mail($to, $subject, $message, $headers); // Confirmation To User echo "<center><h2>Thankyou very much for your time in completing this questionnaire</h2><img src=synergy_gleam_logo.jpg alt=Logo width=327 height=102 /></center>";         }         else         { // include the questionnaire include "htmlform.php";         }              ?>     </body> </html> [/code] wen i add a login script, and put in the user/pass, and submit all that appears is my thankyou page and not the questionnaire. does any know how to make it show the questions and not the thankyou page. or does anyone know how to add http auth using php to this, because i tried that and it wouldnt work thanks in advance andrew
  25. i have been trying out alot of different password protecting scripts for a page i am doing. i have had some problems with it. i have made a questionnaire, and when you submit it, a confirmation page apears sayin thankyou etc etc. and when i add a login for and submit it dosnt show my questionnaire just the confirmation page. i have also tried http authentication but dont really understand it. i need to password protect this to hand into my client for tommorow any ideas would be much apreciated thanks in advance chuddy
×
×
  • 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.