View Single Post
ישן 03-01-07, 17:48   # 1
scarface
חבר פורום
 
מיני פרופיל
תאריך הצטרפות: Dec 2006
הודעות: 61

scarface לא מחובר  

לא מצליח לשלוח יותר ממשתנה אחד ל databace

אני לא יודע למה כל הבעיות חייבות ליפול דווקא אצלי
תראו מה קרה יצרתי טבלא אם עמודות ככה
PHP קוד:
CREATE TABLE `new` (
`
idINT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`
titleTEXT NOT NULL ,
`
topicTEXT NOT NULL 
ENGINE MYISAM 

עכשיו אני רוצה לשלוח לשם נתונים ככה:

אז זה index.html
HTML קוד:
<html>
<title>נסיון </title>
<form method="post" action="send.php">
<input type="text" name="title">
<font>שם הכתבה</font>
<hr>
<input type="text" name="topic">
<font>הכתבה</font>
<hr>
<input type="submit">
</form>
</html>

וזה send.php

PHP קוד:
<?php
$title
$_POST['title'];
$topic$_POST['topic'];
mysql_connect('localhost','******','*******') or die("ERROR: ".mysql_error());
mysql_select_db('******') or die("ERROR: ".mysql_error());
mysql_query("INSERT INTO 'new'('title','topic') VALUES('$title','$topic')") or die("ERROR: ".mysql_error());
echo 
"אם אתה רואה את זה אתה יכול להפסיק להיות נואש כי הצלחת ";
?>
ה error שמופיע
קוד:
ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''new'('title','topic') VALUES('נסיון','נסיון 2')' at line 1
בבקשהה תעזרו לי אני מתחרפן



*** אגבב כשאני מנסה לעשות את אותו דבר אבל לשלוח רק משתנה אחד למסד הנתונים זה כן מצליח .... מוזר...

Last edited by scarface; 03-01-07 at 17:54..
  Reply With Quote