הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   PHP \ MySQL שגיאה שאני נתקבל בה.. (https://hosts.co.il/forums/showthread.php?t=63716)

SlipY 02-06-08 20:03

PHP \ MySQL שגיאה שאני נתקבל בה..
 
אין לי מושג למה ...
אין לי מושג איך...
קוד ממש פשוט ונותן לי שגיאה:

השגיאה:
קוד:

Could not insert the db because 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 'show,desc,link) values ('3','Press Here','http://www.here.com' at line 1
הקוד:

קוד:

<?php
        include 'mysql_connect.php';
        $id = mysql_real_escape_string($_POST['id']);
        $desc = mysql_real_escape_string($_POST['desc']);
        $link = mysql_real_escape_string($_POST['link']);
        $sql = mysql_query("insert into links(show,desc,link)
                                        values ('$id','$desc','$link')") or die("Could not insert the db because " . mysql_error());
                header("Location: index.php?page=staff");
?>


יניב בן צבי 02-06-08 20:23

תנסה ככה:

PHP קוד:

<?php
    
include 'mysql_connect.php';
    
$id mysql_real_escape_string($_POST['id']);
    
$desc mysql_real_escape_string($_POST['desc']);
    
$link mysql_real_escape_string($_POST['link']);
    
$sql mysql_query("insert into links('show','desc','link')
                            values ($id,$desc,$link)"
) or die("Could not insert the db because " mysql_error());
        
header("Location: index.php?page=staff");
?>


Tomer 02-06-08 21:13

show היא מילה שמורה ב SQL וצריך לתחום אותה בגרשיים, כנ"ל desc אאל"ט.


כל הזמנים הם GMT +2. הזמן כעת הוא 07:46.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ