Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
dg:greenbox:add [14 Sep 2011 21:04] jamesdg:greenbox:add [14 Sep 2011 22:29] james
Line 1: Line 1:
 ====== Add Item to Green Box ====== ====== Add Item to Green Box ======
 <php> <php>
 +error_reporting(E_ALL); 
 +
 +ini_set('display_errors', true);
 +
 include("/var/www/html/greenbox/sqlconnect.php");  include("/var/www/html/greenbox/sqlconnect.php"); 
 include("/var/www/html/greenbox/sqlconnect2.php");  include("/var/www/html/greenbox/sqlconnect2.php"); 
  
-$query = "INSERT INTO Items (Year,Type,Freq,Class,Description,Comments,SAN,Contributor,Email,MoreInfoURL,Cell) +$query = "INSERT INTO Items  (Year,Type,Freq,Class,Description,Comments,SAN,Contributor,Email,MoreInfoURL,Cell) 
-            VALUES  + VALUES ($_POST[Year],$_POST[Type],$_POST[Freq],'$_POST[Class]','$_POST[Description]','$_POST[Comments]','$_POST[SAN]','$_POST[Contributor]','$_POST[Email]','$_POST[MoreInfoURL]','$_POST[Cell]')";
-           ('$Year','$Type','$Freq','$Class','$Description','$Comments','$SAN','$Contributor','$Email','$MoreInfoURL','$Cell')";+
   $result = mysql_query($query)   $result = mysql_query($query)
        or die ("Couldn't execute query.");        or die ("Couldn't execute query.");
-  $ItemID = mysql_insert_id();                                    // 46 +        
- +$Year=$_POST[Year]; 
-while ($row mysql_fetch_assoc($result)) +echo $Year;
-+
-  echo "The following item has been added to the database:<br> +
-        <ul> +
-         <li>Type: $row['Type'+
- <li>Frequency: $row['Freq'+
- <li>Class: $row['Class'+
- <li><b>$row['Description'] </b>- $row['Comments'+
- <li>SAN penalty: $row['SAN'+
- <li>Contributed by: $row['Contributor' $row['Email'+
- <li>More info from: $row['MoreInfoURL'+
- <li>Cell $Cell available from $row['Year'] +
- \n"+
-+
-  echo "</ul>"; +
-  echo "Add Another Item\n"; +
 </php> </php>
  
Print/export
QR Code
QR Code Add Item to Green Box (generated for current page)