rtoss - Diff between revs 3 and 352

Subversion Repositories:
Rev:
Show entire file - Ignore whitespace
Rev 3 Rev 352
Line 12... Line 12...
12 $MM_RedirectUrl=$homeURL.$SidebarSuffix1; 12 $MM_RedirectUrl=$homeURL.$SidebarSuffix1;
13 13
14 $Recordset1__MMColParam="1"; 14 $Recordset1__MMColParam="1";
15 if (isset($_GET["id"])) $Recordset1__MMColParam=intval($_GET["id"]); 15 if (isset($_GET["id"])) $Recordset1__MMColParam=intval($_GET["id"]);
16 16
17 $conn=sqlite_popen($sqlite_file); -  
18 $qry="SELECT * FROM Fav WHERE id = ".sqlite_escape_string($Recordset1__MMColParam); -  
19 $rs=sqlite_query($conn,$qry); -  
20 $rcnt=sqlite_num_rows($rs); -  
21 $row = sqlite_fetch_array($rs); -  
-   17 $db = new PDO('sqlite:./'.$sqlite_file, '', '', array(PDO::ATTR_PERSISTENT => true));
-   18 $qry='SELECT * FROM Fav WHERE id = '.$Recordset1__MMColParam;
-   19 $rs=$db->query($qry);
-   20 $row = $rs->fetch(PDO::FETCH_ASSOC);
-   21 $rcnt=is_array($row) ? 1 : 0;
22 22
23 if (isset($_POST["MM_insert"]) && $_POST["MM_insert"]=="form1"){ 23 if (isset($_POST["MM_insert"]) && $_POST["MM_insert"]=="form1"){
24   $Command1_CommandText="UPDATE Fav SET cat = ".sqlite_escape_string($Command1__varcat)." , protected = ".sqlite_escape_string($Command1__varprot)." , catid = ".sqlite_escape_string($Command1__varcatid)." , name = '".sqlite_escape_string($Command1__varname)."' , addr = '".sqlite_escape_string($Command1__varaddr)."' WHERE id = ".sqlite_escape_string($Command1__varid); -  
25   sqlite_exec($Command1_CommandText,$conn); -  
-   24         $sth = $db->prepare('UPDATE Fav SET cat = ?, protected = ?, catid = ?, name = ?, addr = ? WHERE id = ?');
-   25         $sth->execute(array($Command1__varcat, $Command1__varprot, $Command1__varcatid, $Command1__varname. $Command1__varaddr, $Command1__varid));
-   26 //  $Command1_CommandText="UPDATE Fav SET cat = ".sqlite_escape_string($Command1__varcat)." , protected = ".sqlite_escape_string($Command1__varprot)." , catid = ".sqlite_escape_string($Command1__varcatid)." , name = '".sqlite_escape_string($Command1__varname)."' , addr = '".sqlite_escape_string($Command1__varaddr)."' WHERE id = ".sqlite_escape_string($Command1__varid);
-   27 //  sqlite_exec($Command1_CommandText,$conn);
26 28
27   header("Location: ".$MM_RedirectUrl); 29   header("Location: ".$MM_RedirectUrl);
28   exit(); 30   exit();
29 } 31 }
30 32
Line 84... Line 86...
84   '.$MyFav_AddMod_IsPasswordProtected.' 86   '.$MyFav_AddMod_IsPasswordProtected.'
85   <input name="newIsProtected" id="newIsProtected" type="checkbox" value="1" '.($row["protected"]?"checked":'').' '.($row['cat']?"disabled":'').'> 87   <input name="newIsProtected" id="newIsProtected" type="checkbox" value="1" '.($row["protected"]?"checked":'').' '.($row['cat']?"disabled":'').'>
86   <br> 88   <br>
87   '.$MyFav_AddMod_ParentCategory.' 89   '.$MyFav_AddMod_ParentCategory.'
88   <select name="catid" id="catid" onChange="detSel();" '.($row['cat']?"disabled":'').'>'; 90   <select name="catid" id="catid" onChange="detSel();" '.($row['cat']?"disabled":'').'>';
89 -  
-   91
90 $qry="SELECT id,name FROM Fav WHERE cat = 1 ORDER BY ord,id"; 92 $qry="SELECT id,name FROM Fav WHERE cat = 1 ORDER BY ord,id";
91 $rs=sqlite_query($conn,$qry); -  
-   93 $rs=$db->query($qry);
92 echo '    <option value="0">'.$MyFav_Cat_NoCategory.'</option>'; 94 echo '    <option value="0">'.$MyFav_Cat_NoCategory.'</option>';
93   while($row2 = sqlite_fetch_array($rs)) { 95   while($row2 = $rs->fetch(PDO::FETCH_ASSOC)) {
94 echo '    <option value="'.($row2["id"]).'" '.($row2["id"]==$row["catid"]?"selected":'').'>'.($row2["name"]).'</option>'; 96 echo '    <option value="'.($row2["id"]).'" '.($row2["id"]==$row["catid"]?"selected":'').'>'.($row2["name"]).'</option>';
95   } 97   }
96 echo '  </select> 98 echo '  </select>