Note that there are some explanatory texts on larger screens.

plurals
  1. POinserting data into mysql
    text
    copied!<p>My insert and update pages (through my admin forlder) into mysql stopped working. When I try to insert/update details it stays on the same page without adding or updating anything into the database table.</p> <p>I really don't know what happened and don't know where start looking. I didn't make any change to the pages whatsoever.</p> <p>Is there anyone who had the same problem and can kindly give me a clue?</p> <p>Appreciated Francesco</p> <p>Insertng some code if it can be of nay help:</p> <pre><code> &lt;?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if(isset($_POST['username'])) { mysql_select_db($database_satsconn, $satsconn); $query_rstUname = "SELECT members_ID FROM members WHERE username = '$_POST[username]'"; $rstUname = mysql_query($query_rstUname, $satsconn) or die(mysql_error()); $row_rstUname = mysql_fetch_assoc($rstUname); $totalRows_rstUname = mysql_num_rows($rstUname); if($totalRows_rstUname &gt; 0){ $error['uname'] = 'That username is already in use. Please choose another.'; } } if(isset($_POST['pwd']) &amp;&amp; isset($_POST['pwd'])) { if($_POST['pwd'] != $_POST['con_pwd']) { $error['pwd'] = 'Your passwords don\'t match.'; } else { $_POST['pwd'] =md5($_POST['pwd']); } } if(!isset($error)) { if ((isset($_POST["MM_insert"])) &amp;&amp; ($_POST["MM_insert"] == "addUser")) { $insertSQL = sprintf("INSERT INTO members (realname, username, pwd) VALUES (%s, %s, %s)", GetSQLValueString($_POST['realname'], "text"), GetSQLValueString($_POST['username'], "text"), GetSQLValueString($_POST['pwd'], "text")); mysql_select_db($database_satsconn, $satsconn); $Result1 = mysql_query($insertSQL, $satsconn) or die(mysql_error()); } } if ((isset($_POST['members_ID'])) &amp;&amp; ($_POST['members_ID'] != "")) { $deleteSQL = sprintf("DELETE FROM members WHERE members_ID=%s", GetSQLValueString($_POST['members_ID'], "int")); mysql_select_db($database_satsconn, $satsconn); $Result1 = mysql_query($deleteSQL, $satsconn) or die(mysql_error()); $deleteGoTo = "add_member.php"; if (isset($_SERVER['QUERY_STRING'])) { $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&amp;" : "?"; $deleteGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $deleteGoTo)); } mysql_select_db($database_satsconn, $satsconn); $query_rstAdmin = "SELECT * FROM members ORDER BY realname ASC"; $rstAdmin = mysql_query($query_rstAdmin, $satsconn) or die(mysql_error()); $row_rstAdmin = mysql_fetch_assoc($rstAdmin); $totalRows_rstAdmin = mysql_num_rows($rstAdmin); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload