$ _GET 변수를 테이블에 게시하는 데 문제가 있습니다. 내가 다른 스크립트의 모든하지만 listname 및 list_id로를 실행할 때마다
include 'connect.php';
if(isset($_POST['client_name'])) {
$_GET['list']; //these are variables passed through from another page and I want these to post in the same table this page is suppose to post in.
$_GET['list_id'];
$Cname = $_POST['client_name'];
$Cnumber = $_POST['client_number'];
$listid = $_POST['list_id'];
$listname = $_POST['list'];
if(!empty($Cname) && !empty($Cnumber)){
$query = "INSERT INTO clients (id, client_name, client_number, list_name, date_registered, list_id) VALUES ('$userid','$Cname', '$Cnumber', '$listname', now(), '$listid')";
mysql_query($query);
echo '<br />
<br />
You successfully added a new clients to your list <a href="http://somewebsite.com/clients.php">View Update</a>';
mysql_close();
}
else {
echo '<script type="text/javascript">alert("Both fields are required");</script>';
}
데이터베이스 테이블에 게시 :
여기 내 스크립트입니다. get 변수를
과 같은 새 변수에 할당하려고 시도했습니다.$ listNAME = $ _GET [ 'id'];
하지만 난 심지어 MySQL의 INSERT 쿼리 여전히 행운의 $ _GET 변수를 사용하려고
난 여전히 내 테이블의 빈 필드로 끝날 경우에도 그와
이 사람이 나를 도울 수 및 스크립트가 실행될 때 빈 필드를 해결하기 위해 내가 할 수있는 것에 관해 조언을 해주십시오.
<form action="addclient.php" method="POST">
Name of Client: <input type="text" name="client_name">
Client's Number: <input type="text" name="client_number" placeholder="1-876-xxx-xxx">
<input type="submit" >
</form>
get 변수를 출력 할 때 표시되는 내용은 무엇입니까? –
@ Murd URL에 전달 된 변수의 정보가 – mattchambers
인데, 열이 적절한 데이터 유형으로 설정되어 있습니까? varchar 또는 텍스트 또는 >>? –