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

הוסטס - פורום אחסון האתרים הגדול בישראל (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=27061)

-VladK- 23-07-06 09:41

חיחי
PHP קוד:

<?php

mysql_connect
('localhost',saaaad,'sado');
mysql_select_db('news'); // &auml;&ccedil;&igrave;&oacute; &agrave;&uacute; &auml;&ugrave;&iacute; &ugrave;&igrave; &aacute;&ntilde;&eacute;&ntilde; &auml;&eth;&uacute;&aring;&eth;&eacute;&iacute; &aacute;&ugrave;&iacute; &ugrave;&agrave;&uacute;&auml; ÷&aacute;&ograve;&uacute;
$result mysql_query("SELECT * FROM `news` ORDER BY `id` DESC");

// &auml;&ouml;&acirc;&uacute; &auml;&euml;&uacute;&aacute;&aring;&uacute;
while ($row=mysql_fetch_array($result))
{
    echo (
"<table width=\"600\" cellpadding=\"2\" cellspacing=\"2\" border=\"1\">");
    echo (
"<tr>");
    echo (
"<td bgcolor=\"gray\" width=\"100%\">".$row['subject']."</td>");
    echo (
"</tr> ");
    echo (
"<td bgcolor=\"white\" width=\"100%\">".$row['content']."</td>");
    echo (
"</tr>");
    echo (
"</table>");
    echo (
"<br>");
}

?>

זה חייב לעבוד!!

opsite 23-07-06 09:42

לצערי לא :(
http://www.logic-serv.co.il/1/add_news.php

-VladK- 23-07-06 09:43

ציטוט:

נכתב במקור על ידי Logic-serv

אחי...תגיד...הטבלה שלך בכלל קיימת?!? הטבלה NEWS קיימת?

בניה 23-07-06 09:43

ב"ה


יש בעיה בחיבור/שאילתא למסד נתונים.
שים את זה:
ותגיד איזו שגיאה כתוב:
PHP קוד:

<?php

mysql_connect
('localhost',saaaad,'sado');
mysql_select_db('news'); // &auml;&ccedil;&igrave;&oacute; &agrave;&uacute; &auml;&ugrave;&iacute; &ugrave;&igrave; &aacute;&ntilde;&eacute;&ntilde; &auml;&eth;&uacute;&aring;&eth;&eacute;&iacute; &aacute;&ugrave;&iacute; &ugrave;&agrave;&uacute;&auml; &ordm;&aacute;&ograve;&uacute;
$result mysql_query("SELECT * FROM 'news' ORDER BY 'id' DESC") or die(mysql_error());

// &auml;&ouml;&acirc;&uacute; &auml;&euml;&uacute;&aacute;&aring;&uacute;
while ($row=mysql_fetch_array($result))
{
    echo (
'<table width="600" cellpadding="2" cellspacing="2 border=1">');
    echo (
"<tr>");
    echo (
"<td bgcolor=\"gray\" width=\"100%\">" $x['subject'] . "</td> ");
    echo (
"</tr> ");
    echo (
"<td bgcolor=\"white\" width=\"100%\">" $x['content'] . "</td> ");
    echo (
"</tr> ");
    echo (
"</table> ");
    echo (
"<br>");
}

?>


opsite 23-07-06 09:43

ברור מה נראה לך

opsite 23-07-06 09:44

כמעט חח תראה
http://www.logic-serv.co.il/1/add_news.php

-VladK- 23-07-06 09:44

ציטוט:

נכתב במקור על ידי Logic-serv
ברור מה נראה לך

השיאלתה שלך גרוע! מה שהבאתי לך עובד ב100%....כנראה יש לך בעיה במסד....

תחליף תשורה:
$result = mysql_query("SELECT * FROM 'news' ORDER BY 'id' DESC")
ב:
$result = mysql_query("SELECT * FROM 'news' ORDER BY 'id' DESC") or die(mysql_error());

opsite 23-07-06 09:45

אין לי בעיה במסד המערכת אחרת המסד עבד

תראה עכשיו החלפתי תראה
http://www.logic-serv.co.il/1/add_news.php

ושעשיתי גרש עקום כתב לי
Query was empty

-VladK- 23-07-06 09:49

אחי שמתה גרש במקום הלא נכון!

opsite 23-07-06 09:50

שמתי פה

$result = mysql_query("SELECT * FROM 'news' ORDER BY 'id' DESC") or die(mysql_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 ''news' ORDER BY 'id' DESC' at line 1


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

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