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

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

4ior 26-04-07 21:38

תשנה את זה רגע לזה:
PHP קוד:

<?
include "config.php"
if ( !isset(
$_POST['messege']) ) {
$query mysql_query("SELECT * FROM `msg` LIMIT `1`") or die(mysql_error()); 
$con mysql_fetch_object($query);
$msg $con->Updote;
echo 
"
<html> 
<head>
<form action='messege.php' method='POST'> 
<div align='center'> 
<textarea name='messege'>$msg</textarea> 
<input type='hidden' value='1' name='xds' />
<input type='submit' value='עדכן תיבה'>
</form> 
</html>
"
;
}

else {
$update $_POST['messege'];
mysql_query("UPDATE `msg` SET Updote = '$update'") or die(mysql_error());
}
?>


Gold-System 26-04-07 21:43

שיניתי,

שגיאה -
ציטוט:

Parse error: syntax error, unexpected T_SL, expecting ',' or ';' in /home/goldsyst/domains/goldsystem.co.il/public_html/Panel/messege.php on line 9

4ior 26-04-07 22:03

תעדכן

Gold-System 26-04-07 22:05

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 '1`' at line 1

Eran-s 26-04-07 22:21

תנסה לרשום LIMIT 0,1 (כמובן בלי גרש)

Gold-System 26-04-07 22:24

כך?
PHP קוד:

$query mysql_query("SELECT * FROM `msg` LIMIT LIMIT 0,1") or die(mysql_error()); 


Eran-s 26-04-07 22:26

LIMIT אחד

Gold-System 26-04-07 22:27

אה, סליחה, לא שמתי לב ..
ולא עובד ..
PHP קוד:

<?
include "config.php"
if ( !isset(
$_POST['messege']) ) {
$query mysql_query("SELECT * FROM `msg` LIMIT 0,1") or die(mysql_error()); 
$con mysql_fetch_object($query);
$msg $con->Updote;
echo 
"
<html> 
<head>
<form action='messege.php' method='POST'> 
<div align='center'> 
<textarea name='messege'>$msg</textarea> 
<input type='hidden' value='1' name='xds' />
<input type='submit' value='עדכן תיבה'>
</form> 
</html>
"
;
}

else {
$update $_POST['messege'];
mysql_query("UPDATE `msg` SET Updote = '$update'") or die(mysql_error());
}
?>


Eran-s 26-04-07 22:28

והשגיאה היא?

Gold-System 26-04-07 22:31

שגיאה - אין.
פשוט לא שומר את הנתונים בתיבה.


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

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