
29-05-2009, 16:21
|
 |
|
|
חבר מתאריך: 07.04.09
הודעות: 95
|
|
|
שמתי את הקוד ואני מקבל שגיאה
ניסיתי לשים את הקוד בכל מיני דרכים ואני קיבלתי שגיאה
אולי יעזור אם אני יכניס לפה את הדף שבניתי
אז הנה הקוד המלא :
קוד PHP:
<?php require_once('Connections/tutoryal.php'); ?> <?php require_once('Connections/tutoryal.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $currentPage = $_SERVER["PHP_SELF"]; mysql_select_db($database_tutoryal, $tutoryal); $query_Recordset1 = "SELECT * FROM image ORDER BY id ASC"; $Recordset1 = mysql_query($query_Recordset1, $tutoryal) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); $queryString_Recordset1 = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_Recordset1") == false && stristr($param, "totalRows_Recordset1") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams)); } } $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1); ?><style type="text/css"> <!-- #as { border-top-width: 12px; border-right-width: 12px; border-bottom-width: 12px; border-left-width: 12px; border-top-style: groove; border-right-style: groove; border-bottom-style: inset; border-left-style: groove; border-top-color: #0066CC; border-right-color: #0066CC; border-bottom-color: #0066CC; border-left-color: #0099CC; } --> </style> <?php do { ?> <?php if ($totalRows_Recordset1 > 0) { // Show if recordset not empty ?> <table width="650" border="1" align="center" cellpadding="0" cellspacing="0" id="as"> <tr> <td height="70" colspan="2" align="right" valign="top" bgcolor="#CCCCCC"><?php echo $row_Recordset1['title']; ?></td> <td width="176" rowspan="3" align="right" valign="top"><img src="<?php echo $row_Recordset1['image']; ?>" height="176" width="176"/></td> </tr> <tr align="right" valign="top"> <td height="63" colspan="2" bgcolor="#99FFCC"><p><?php echo $row_Recordset1['des']; ?></p> <p> </p> <p> </p> <p> </p></td> </tr> <tr align="right" valign="top"> <td width="231" height="63" bgcolor="#99FFCC"><a href="remove.php?id=<?php echo $row_Recordset1['id']; ?>"><p onClick="GP_popupConfirmMsg('האם ברצונכם למחוק את המידע הנוכחי ?');return document.MM_returnValue">הסרה</p> </body></a></td> <td width="213" bgcolor="#99FFCC"><a href="testtesttest.php?id=<?php echo $row_Recordset1['id']; ?>">עריכה</a></td> </tr> </table> <p> </p> <p> </p> <p align="center"> <?php } // Show if recordset not empty ?> </p> <?php if ($totalRows_Recordset1 == 0) { // Show if recordset empty ?> <div align="center"><strong>שום מודעה לא נמצאה</strong> </div> </div> <?php } // Show if recordset empty ?> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> </div> <p align="center"> <?php mysql_free_result($Recordset1); ?> <a href="index2.php">להוספת מודעה לחץ כאן</a></p> <p align="center"> </p> <p align="center"> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p>
זה התקציר שאני רוצה שרק התווים הראשונים יופיעו
קוד PHP:
<?php echo $row_Recordset1['des']; ?>
וכל השאר נראה את המילים המלאים.
איך עושים זאת איך אני משלב את הקודים שנתתם לי לתוך הקודים שיש לי עכשיו ?
השילוב בשבילי זה השלב הכי קשה , כי ראיתי את הפונקציה למעלה והיא פועלת לבד בתוך קובץ ריק
אבל ברגע שאני משלב יש לי שגיאות ובלגנים , אשמח לכל מי שידע לסדר לי את הבלגן.
תודה מראש
|