chloebyte Posted November 18, 2015 Share Posted November 18, 2015 (edited) This is the page im getting the error at when it directs: <?php $username = ""; $password = ""; $databasename = ""; $hostname = "localhost"; //connect to db $dbconnection = new mysqli($hostname, $username, $password, $databasename) or die("Unable to connect to MySQL". $dbconnection->connect_error); session_start(); // processes form if (isset($_POST['submit'])) { if (is_numeric($_POST['id'])) { // get form data, making sure it is valid $id = $_POST['id']; $num = mysql_real_escape_string(htmlspecialchars($_POST['number'])); $g = mysql_real_escape_string(htmlspecialchars($_POST['gender'])); $t = mysql_real_escape_string(htmlspecialchars($_POST['title'])); $gn = mysql_real_escape_string(htmlspecialchars($_POST['givenname'])); $sn = mysql_real_escape_string(htmlspecialchars($_POST['surname'])); $sa = mysql_real_escape_string(htmlspecialchars($_POST['streetaddress'])); $c = mysql_real_escape_string(htmlspecialchars($_POST['city'])); $s = mysql_real_escape_string(htmlspecialchars($_POST['state'])); $zc = mysql_real_escape_string(htmlspecialchars($_POST['zipcode'])); $c = mysql_real_escape_string(htmlspecialchars($_POST['country'])); $ea = mysql_real_escape_string(htmlspecialchars($_POST['emailaddress'])); $u = mysql_real_escape_string(htmlspecialchars($_POST['username'])); $pwd = mysql_real_escape_string(htmlspecialchars($_POST['password'])); $tel = mysql_real_escape_string(htmlspecialchars($_POST['telephonenumber'])); $telcc = mysql_real_escape_string(htmlspecialchars($_POST['telephonecountrycode'])); $bday = mysql_real_escape_string(htmlspecialchars($_POST['birthday'])); $cctype = mysql_real_escape_string(htmlspecialchars($_POST['cctype'])); $ccno = mysql_real_escape_string(htmlspecialchars($_POST['ccnumber'])); $ccexp = mysql_real_escape_string(htmlspecialchars($_POST['ccexpires'])); $mnme = mysql_real_escape_string(htmlspecialchars($_POST['maidenname'])); $natid = mysql_real_escape_string(htmlspecialchars($_POST['nationalid'])); $btype = mysql_real_escape_string(htmlspecialchars($_POST['bloodtype'])); $occ = mysql_real_escape_string(htmlspecialchars($_POST['occupation'])); $company = mysql_real_escape_string(htmlspecialchars($_POST['company'])); $vehicle = mysql_real_escape_string(htmlspecialchars($_POST['vehicle'])); $color = mysql_real_escape_string(htmlspecialchars($_POST['color'])); // check that fieldsfilled in if ($number == '' || $gender == '' || $title == '' || $givenname == '' || $surname == '' || $streetaddress == '' || $city == '' || $state == '' || $zipcode == '' || $country == '' || $emailaddress == '' || $username == '' || $password == '' || $telephonenumber == '' || $telephonecountrycode == '' || $birthday == '' || $cctype == '' || $ccnumber == '' || $ccexpires == '' || $maidenname == '' || $bloodtype == '' || $occupation == '' || $company == '' || $vehicle == '' || $color == '' ) { // error message $error = 'ERROR: Please fill in all required fields!'; //error, display form renderForm($number, $gender, $title, $givenname, $surname, $streetaddress, $city, $state, $zipcode, $country, $emailaddress, $username, $password, $telephonenumber, $telephonecountrycode, $birthday, $cctype, $ccnumber, $ccexpires, $maidenname, $nationalid, $bloodtype, $occupation, $company, $vehicle, $color); } else { // save the data to the database mysql_query("UPDATE clientData SET number='$number', gender='$gender', title='$title', givenname='$givenname', surname='$surname', streetaddress='$streetaddress', city='$city', state='$state, zipcode='$zipcode', country='$country', emailaddress='$emailaddress', username='$username', password='$password', telephonenumber='$telephonenumber', telephonecountrycode='$telephonecountrycode', birthday='$birthday', cctype='$cctype', ccnumber='$ccnumber', ccexpires='$ccexpires', maidenname='$maidenname', bloodtype='$bloodtype', occupation='$occupation', company='$company', vehicle='$vehicle', color='$color',WHERE id='$id'") or die(mysql_error()); // once saved, redirect back header("Location: ContentManagement.php"); } } else { // display error if invalid echo 'Error!'; } } else { if (isset($_GET['id']) && is_numeric($_GET['id']) && $_GET['id'] > 0) { // query db $id = $_GET['id']; $result = mysql_query("SELECT * FROM clientData WHERE number=$id") or die(mysql_error()); $row = mysql_fetch_array($result); // check that the 'id' matches up with a row in the databse if($row) { // get data from db $number = $_POST['number']; $gender= $_POST['gender']; $title = $_POST['title']; $givename = $_POST['givenname']; $surename = $_POST['surname']; $streetaddress = $_POST['streetaddress']; $city= $_POST['city']; $state = $_POST['state']; $zipcode = $_POST['zipcode']; $country = $_POST['country']; $emailaddreess = $_POST['emailaddress']; $username = $_POST['username']; $password = $_POST['password']; $telephone = $_POST['tel']; $telephonecountrycode = $_POST['telephonecountrycode']; $birthday = $_POST['birthday']; $cctypy = $_POST['cctype']; $ccnumber = $_POST['ccnumber']; $ccexpires = $_POST['ccexpires']; $maidenname = $_POST['maidenname']; $nationalid = $_POST['nationalid']; $bloodtype = $_POST['bloodtype']; $occupation = $_POST['occupation']; $company = $_POST['company']; $vehicle = $_POST['vehicle']; $color = $_POST['color']; // show form renderForm($number, $gender, $title, $givenname, $surname, $streetaddress, $city, $state, $zipcode, $country, $emailaddress, $username, $password, $telephonenumber, $telephonecountrycode, $birthday, $cctype, $ccnumber, $ccexpires, $maidenname, $nationalid, $bloodtype, $occupation, $company, $vehicle, $color, ''); } else // if no match, display "No results" { echo "No results!"; } } else // if the 'id' in the URL isn't valid, or if there is no 'id' value, display an error { echo 'Error!'; } } ?> This is the form /works fine <Title>Content Management</Title> <style> html{ background:#fff; } body { background-color: linen; width:80%; min-width: 767px; margin:15px auto; border:1px solid black; padding:15px } table.center { width:70%; margin-left:15%; margin-right:15%; } table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 1px; } th { background-color: red; color: white; )</style> <body> <a href="adduser.html"><button type="button">Add Client</button></a> <?php $username = ""; $password = ""; $databasename = ""; $hostname = "localhost"; //connect to db $dbconnection = new mysqli($hostname, $username, $password, $databasename) or die("Unable to connect to MySQL". $dbconnection->connect_error); session_start(); $sqlquery= "SELECT * FROM clientData LIMIT 30"; //select everything. $queryResult = $dbconnection->query($sqlquery); if ($queryResult->num_rows > 0) { echo "<table width =90% align = center>"; while($row = $queryResult->fetch_assoc()) { echo"<tr><form action = 'editclientscript.php' method ='post'><input type ='hidden' name='userid' value=". $row["number"] .">"; echo "<th colspan = 5>" . $row["username"] . "</th></tr>"; echo "<tr><th>Title</th><th>First Name</th><th>Last Name</th><th colspan=2></th></tr>"; echo "<tr><td>" . $row["title"] . "</td><td>" . $row["givenname"] . "</td><td>" . $row["surname"] . "</td><td colspan=2></td></tr>"; echo "<tr><th>Street Address</th><th>City</th><th>State</th><th>Zipcode</th><th>Country</th></tr>"; echo "<tr><td>" . $row["streetaddress"] . "</td><td>" . $row["city"] . "</td><td>" . $row["state"] . "</td><td>" . $row["zipcode"] . "</td><td>" . $row["country"] . "</td></tr>"; echo "<tr><th>E-mail</th><th>Area Code</th><th>Telephone</th><th colspan=2></th></tr>"; echo "<tr><td>" . $row["emailaddress"] . "</td><td>" . $row["telephonecountrycode"] . "</td><td>" . $row["telephonenumber"] . "</td><td colspan =2></td></tr>"; if($_SESSION["uAL"]<=4){ echo "<tr><th>Gender</th><th>DOB</th><th>Maiden name</th><th>National ID</th><th>Blood Type</th></tr>"; echo "<tr><td>" . $row["gender"] . "</td><td>" . $row["birthday"] . "</td><td>" . $row["maidenname"] . "</td><td>" . $row["nationalid"] . "</td><td>" . $row["bloodtype"] . "</td></tr>"; echo "<tr><th>Company</th><th>Job Title</th><th>Vehicle</th><th>Favourite Colour</th><th></th></tr>"; echo "<tr><td>" . $row["company"] . "</td><td>" . $row["occupation"] . "</td><td>" . $row["vehicle"] . "</td><td>" . $row["color"] . "</td><td></td></tr>"; } if($_SESSION["uAL"]<=3){ echo "<tr><th>CC Type</th><th>CC Number</th><th>CC expires</th><th colspan = 2></tr>"; echo "<tr><td>" . $row["cctype"] . "</td><td>" . $row["ccnumber"] . "</td><td>" . $row["ccexpires"] . "</td>"; } if($_SESSION["uAL"]<=2){ echo "<th>Administration</th>"; echo "<td><input type='submit' value='Modify Data'></td></tr>"; } elseif($_SESSION["uAL"]<=3){ echo "<td colspan=2></td></tr>"; } echo "</form><tr><td colspan=5></td></tr>"; } echo "</table>"; } else { echo "Huh, no results... Weird."; } $dbconnection ->close(); ?> </body> </html> Wheres the error at the output is just "Error" Edited November 18, 2015 by chloebyte Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/ Share on other sites More sharing options...
Jacques1 Posted November 18, 2015 Share Posted November 18, 2015 First of all: How about you generate sensible error messages which actually allow you (and your users) to figure out the problem? This would make life much easier. Large parts of your code are also nonsensical. For example, you have a random mixture of mysql_* functions and mysqli_* functions. Don't you realize that those are two entirely different PHP extensions? And why do you HTML-escape all input before inserting it into the database? This will leave you with tons of “garbage data” full of HTML entities. I strongly recommend you learn the basics of PHP before you write any serious application. As to your original problem: Are you sure you want to check for $_POST['submit']? Because the value of your submit button seems to be “Modify Data”. To avoid this kind of confusion in the future, I recommend you simply check if the request used the POST method: if ($_SERVER['REQUEST_METHOD'] == 'POST') { ... } Then you don't have to rely on the value of some obscure submit button. Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526632 Share on other sites More sharing options...
chloebyte Posted November 18, 2015 Author Share Posted November 18, 2015 (edited) First of all: How about you generate sensible error messages which actually allow you (and your users) to figure out the problem? This would make life much easier. Large parts of your code are also nonsensical. For example, you have a random mixture of mysql_* functions and mysqli_* functions. Don't you realize that those are two entirely different PHP extensions? And why do you HTML-escape all input before inserting it into the database? This will leave you with tons of “garbage data” full of HTML entities. I strongly recommend you learn the basics of PHP before you write any serious application. As to your original problem: Are you sure you want to check for $_POST['submit']? Because the value of your submit button seems to be “Modify Data”. To avoid this kind of confusion in the future, I recommend you simply check if the request used the POST method: if ($_SERVER['REQUEST_METHOD'] == 'POST') { ... } Then you don't have to rely on the value of some obscure submit button. So would this work? // processes form if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (is_numeric($_POST['id'])) { instead of // processes form if (isset($_POST['submit'])) { if (is_numeric($_POST['id'])) { Edited November 18, 2015 by chloebyte Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526633 Share on other sites More sharing options...
Jacques1 Posted November 18, 2015 Share Posted November 18, 2015 The best way to find out is to try it. Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526636 Share on other sites More sharing options...
cyberRobot Posted November 18, 2015 Share Posted November 18, 2015 Have you tried enabling all PHP errors and warnings? To do that, you can add the following to the top of your PHP script during the debugging process: error_reporting(E_ALL); ini_set('display_errors', 1); Based on a quick look, I didn't see a form field named "id". Without id, $_POST['id'] isn't going to be set. Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526639 Share on other sites More sharing options...
cyberRobot Posted November 18, 2015 Share Posted November 18, 2015 Also note that you need to use input fields when passing data through forms. Perhaps the following article will help: http://php.net/manual/en/tutorial.forms.php Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526640 Share on other sites More sharing options...
chloebyte Posted November 18, 2015 Author Share Posted November 18, 2015 The best way to find out is to try it. I just get "Error" ;/ Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526641 Share on other sites More sharing options...
chloebyte Posted November 18, 2015 Author Share Posted November 18, 2015 Have you tried enabling all PHP errors and warnings? To do that, you can add the following to the top of your PHP script during the debugging process: error_reporting(E_ALL); ini_set('display_errors', 1); Based on a quick look, I didn't see a form field named "id". Without id, $_POST['id'] isn't going to be set. yeah get this now Notice: Undefined index: id in /home//ContentManagment/editclientscript.php on line 22 Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526642 Share on other sites More sharing options...
chloebyte Posted November 18, 2015 Author Share Posted November 18, 2015 (edited) well erm.... Notice: Undefined index: number in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 26 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 26 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 26 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 26 Notice: Undefined index: gender in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 27 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 27 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 27 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 27 Notice: Undefined index: title in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 28 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 28 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 28 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 28 Notice: Undefined index: givenname in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 29 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 29 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 29 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 29 Notice: Undefined index: surname in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 30 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 30 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 30 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 30 Notice: Undefined index: streetaddress in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 31 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 31 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 31 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 31 Notice: Undefined index: city in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 32 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 32 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 32 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 32 Notice: Undefined index: state in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 33 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 33 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 33 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 33 Notice: Undefined index: zipcode in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 34 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 34 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 34 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 34 Notice: Undefined index: country in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 35 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 35 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 35 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 35 Notice: Undefined index: emailaddress in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 36 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 36 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 36 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 36 Notice: Undefined index: username in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 37 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 37 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 37 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 37 Notice: Undefined index: password in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 38 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 38 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 38 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 38 Notice: Undefined index: telephonenumber in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 39 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 39 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 39 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 39 Notice: Undefined index: telephonecountrycode in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 40 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 40 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 40 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 40 Notice: Undefined index: birthday in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 41 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 41 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 41 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 41 Notice: Undefined index: cctype in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 42 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 42 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 42 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 42 Notice: Undefined index: ccnumber in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 43 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 43 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 43 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 43 Notice: Undefined index: ccexpires in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 44 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 44 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 44 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 44 Notice: Undefined index: maidenname in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 45 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 45 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 45 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 45 Notice: Undefined index: nationalid in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 46 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 46 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 46 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 46 Notice: Undefined index: bloodtype in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 47 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 47 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 47 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 47 Notice: Undefined index: occupation in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 48 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 48 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 48 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 48 Notice: Undefined index: company in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 49 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 49 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 49 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 49 Notice: Undefined index: vehicle in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 50 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 50 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 50 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 50 Notice: Undefined index: color in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 51 Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 51 Warning: mysql_real_escape_string(): Access denied for user 'u814955296'@'10.2.1.28' (using password: NO) in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 51 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 51 Notice: Undefined variable: number in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 54 Fatal error: Call to undefined function renderForm() in /home/u814955296/public_html/ContentManagment/editclientscript.php on line 61 after i fixed 'id'^ Edited November 18, 2015 by chloebyte Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526645 Share on other sites More sharing options...
Jacques1 Posted November 18, 2015 Share Posted November 18, 2015 Yeah, that's what I meant by “nonsensical code”. Personally, I'd scrap this stuff and start over, this time with valid PHP code. Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526647 Share on other sites More sharing options...
cyberRobot Posted November 18, 2015 Share Posted November 18, 2015 yeah get this now Notice: Undefined index: id in /home//ContentManagment/editclientscript.php on line 22 The only data that's passed through your form is from the following: <input type ='hidden' name='userid' value=". $row["number"] .">"; If that's the ID you're trying to test, then the POST variable should be $_POST['userid'] But you still need to address the fact that the rest of the data isn't being passed. Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526650 Share on other sites More sharing options...
chloebyte Posted November 18, 2015 Author Share Posted November 18, 2015 Yeah, that's what I meant by “nonsensical code”. Personally, I'd scrap this stuff and start over, this time with valid PHP code. ya gonna scrap;/ do you know of anything out there what uses the same concept because idk where to start now really Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526653 Share on other sites More sharing options...
cyberRobot Posted November 18, 2015 Share Posted November 18, 2015 do you know of anything out there what uses the same concept because idk where to start now really What's the overall goal of the project? Are you trying to build an e-commerce website? There appears to be a lot of high-risk information being stored in your database (such as credit card information and national ID [assuming that's something like a social security number]). Do you really need all that information? If so, is the information being protected? Quote Link to comment https://forums.phpfreaks.com/topic/299511-error-with-sql-script/#findComment-1526692 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.