السلام عليكم ورحمة الله وبركاتة
قمت بعمل اسكريبت اخبارى ولكن كيف اعرض محتويات الموضع فى صفحة جافا اسكريبت وممن يعرف الطريقة ياريت يجرب الاسكريبت بحيث يعمل
قاعدة البيانات
/* ========================================================= CREATE TABLE `news` ( `id` TINYINT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `title` VARCHAR( 50 ) NOT NULL , `subject` VARCHAR( 51 ) NOT NULL ) ENGINE = innodb; ========================================================= */
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Title here!</title>
</head>
<body>
<?php
$host="localhost";
$user="root";
$pass="";
$database="news";
$table="news";
$link = mysql_connect('localhost', "$user", "$pass")or print"failed connection";
mysql_select_db($database,$link)or print "not exists";
$_sql="INSERT INTO $table(title,subject)VALUES('my test script...news','this is my topic')";
$result=mysql_query($_sql,$link);
/*if($result)
{
echo"sucess entery data";
}else{
echo"failed entery data";
} */
$query=("select * from $table");
$result= mysql_db_query($database,$query,$link);
?>
<table width=100% height=35>
<tr>
<td bgcolor=iceyellow>
<marquee direction="right" onmouseover="this.scrollAmount=0" onmouseout="this.scrollAmount=4">
<? while ($row = mysql_fetch_assoc($result) )
{
$title =$row['title'];
$subject =$row['subject'];
echo "<a href='inselect.php?title=$tile'>.::::.$subject</a>";
}
?>
</marquee>
</td>
</tr>
</table>
</body>
</html>