Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-03-2022, 11:01 AM   #1
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,188
Why wont this let me add more than 1 record?

So I have the basic CRUD setup but when it comes to adding a new domain (or several records) it will allow me to add the first record (ID=0) in the database, but then wont let me add anything additional, can anyone tell me why?

Quote:
<html>
<head>
<base href="https://gfy.com/" /><!--[if IE]></base><![endif]-->
<title>Add Domain</title>
</head>

<body>
<a href="index.php">Go to Home</a>
<br/><br/>

<form action="add.php" method="post" name="form1">
<table width="25%" border="0">
<tr>
<td>Registrar</td>
<td><input type="text" name="Registrar"></td>
</tr>
<tr>
<td>Domain</td>
<td><input type="text" name="DomainName"></td>
</tr>
<tr>
<td>Registered</td>
<td><input type="text" name="Registration"></td>
</tr>
<tr>
<td>Expires</td>
<td><input type="text" name="Expiration"></td>
</tr>
<tr>
<td>NS1</td>
<td><input type="text" name="NameServer1"></td>
</tr>
<tr>
<td>NS2</td>
<td><input type="text" name="NameServer2"></td>
</tr>
<tr>
<td>Status</td>
<td><input type="text" name="Status"></td>
</tr>
<tr>
<td>Notes</td>
<td><input type="text" name="Notes"></td>
</tr>
<tr>

<td></td>
<td><input type="submit" name="Submit" value="Add"></td>
</tr>
</table>
</form>

<?php

// Check If form submitted, insert form data into table.
if(isset($_POST['Submit'])) {


$Registrar=$_POST['Registrar'];
$DomainName=$_POST['DomainName'];
$Registration=$_POST['Registration'];
$Expiration=$_POST['Expiration'];
$NameServer1=$_POST['NameServer1'];
$NameServer2=$_POST['NameServer2'];
$Status=$_POST['Status'];
$Notes=$_POST['Notes'];

// include database connection file
include_once("config.php");

// Insert user data into table
$result = mysqli_query($mysqli, "INSERT INTO DomainManagement(Registrar,DomainName,Registration ,Expiration,NameServer1,NameServer2,Status,Notes) VALUES('$Registrar','$DomainName','$Registration', '$Expiration','$NameServer1','$NameServer2','$Stat us','$Notes')");

// Show message when user added
echo "Record added successfully. <a href='index.php'>View Users</a>";
}
?>
</body>
</html>
Been playing with this a few hours trying to figure out why and its driving me crazy, it isnt kicking out any errors, just isnt entering data into the table
__________________
Extreme Link List - v1.0
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2022, 11:13 AM   #2
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,110
Quote:
Originally Posted by Publisher Bucks View Post
So I have the basic CRUD setup but when it comes to adding a new domain (or several records) it will allow me to add the first record (ID=0) in the database, but then wont let me add anything additional, can anyone tell me why?



Been playing with this a few hours trying to figure out why and its driving me crazy, it isnt kicking out any errors, just isnt entering data into the table
Without knowing more about the table you are inserting into, it is hard to say. Could be duplicate entry on a unique index, not sure. Also not sure what level you are reporting errors. When I am in development mode I have all error reporting php and mysql turned on so I can see anything that goes wrong. I also put message s in the code so I can see exactly what is happening and when.

However, in what you posted, if it is the code that you are running there is a space in '$status' that should not be there, but that should blow it off every time not just on subsequent runs.

Quote:
$result = mysqli_query($mysqli, "INSERT INTO DomainManagement(Registrar,DomainName,Registration ,Expiration,NameServer1,NameServer2,Status,Notes) VALUES('$Registrar','$DomainName','$Registration', '$Expiration','$NameServer1','$NameServer2','$Stat us','$Notes')");
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2022, 12:55 PM   #3
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,188
Thanks.

That 'Status' one just seems to be on GFY, its not on the server version, must have just been a FF issue.

Would you possibly be able to share the php code that I can use to check MySQL for errors? :D
__________________
Extreme Link List - v1.0
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2022, 02:38 PM   #4
Klen
 
Klen's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
Quote:
Originally Posted by Publisher Bucks View Post
Thanks.

That 'Status' one just seems to be on GFY, its not on the server version, must have just been a FF issue.

Would you possibly be able to share the php code that I can use to check MySQL for errors? :D
This: https://www.w3schools.com/php/func_mysqli_error.asp
Klen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2022, 02:45 PM   #5
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,110
Quote:
Originally Posted by Klen View Post
That would work.

.
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2022, 02:54 PM   #6
blackmonsters
Making PHP work
 
blackmonsters's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 20,564
Quote:
Originally Posted by sarettah View Post
Without knowing more about the table you are inserting into, it is hard to say. Could be duplicate entry on a unique index, not sure. Also not sure what level you are reporting errors. When I am in development mode I have all error reporting php and mysql turned on so I can see anything that goes wrong. I also put message s in the code so I can see exactly what is happening and when.

However, in what you posted, if it is the code that you are running there is a space in '$status' that should not be there, but that should blow it off every time not just on subsequent runs.
Yeah, I dont see an "ID" field in the insert code.
The DB is set to "auto index"; but he has no field defined for the auto index.


// Insert user data into table
$result = mysqli_query($mysqli, "INSERT INTO DomainManagement(Registrar,DomainName,Registration ,Expiration,NameServer1,NameServer2,Status,Notes) VALUES('$Registrar','$DomainName','$Registration', '$Expiration','$NameServer1','$NameServer2','$Stat us','$Notes')");

The SQL table should have a record ID field. (You can do anything you want but ID is standard)
The ID will be "" in the data fields so that SQL will create the ID number on insert for you.

The code should look like this, I think.

// Insert user data into table
$result = mysqli_query($mysqli, "INSERT INTO DomainManagement(ID,Registrar,DomainName,Registration ,Expiration,NameServer1,NameServer2,Status,Notes) VALUES("", '$Registrar','$DomainName','$Registration', '$Expiration','$NameServer1','$NameServer2','$Stat us','$Notes')");


__________________
Make Money with Porn
blackmonsters is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2022, 06:39 PM   #7
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,188
Thank you all for the help, I fixed the issue.

It was a messed up AI/NULL setting in the table.
__________________
Extreme Link List - v1.0
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-07-2022, 06:35 AM   #8
mikeworks
Confirmed User
 
Join Date: Apr 2010
Posts: 272
I recommend Mamp Pro/xDebug/Phpstorm. Using xDebug you can see what is happening at each step to help debug things.
mikeworks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-07-2022, 06:37 AM   #9
Klen
 
Klen's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
Quote:
Originally Posted by mikeworks View Post
I recommend Mamp Pro/xDebug/Phpstorm. Using xDebug you can see what is happening at each step to help debug things.
I know for Xdebug, but it's nothing special - i for debugging using command php -l, and so far there was no need for anything else. There is also option to use IDE like netbeans which have integrated debugger.
Klen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
add, domain, record, additional, status, id=0, database, notes, ns2, registrar, registered, expires, home, helpme, ns1, basic, crud, setup, records, adding



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.