Jump to content


Photo

news script ..need support


  • Please log in to reply
3 replies to this topic

#1 ahmed17

ahmed17
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 09 October 2006 - 09:00 PM

hi guys,

i am try to make news script  display news in my database  aso i make script but i need some help...i want data display flow in one row using marquee  and when i  press on the title  as a link  display the subject in new window

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
       <title>Title here!</title>
</head>
<body>
<?php
/*
=========================================================
CREATE TABLE `news` (
`id` TINYINT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`title` VARCHAR( 50 ) NOT NULL ,
`subject` VARCHAR( 51 ) NOT NULL
) ENGINE = innodb;
=========================================================
*/
$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);


while($row=mysql_fetch_array($result))
{


   echo"<br>";
   $move=$row['title'];
   echo "<marquee>$move</marquee>";
    echo"<br>";
   echo $row['subject'];
     echo"<br>";


   }
?>


</body>
</html>


#2 amalosoul

amalosoul
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 09 October 2006 - 09:09 PM

Well depends on what you understand by a new window...if you want a special window than you have to use javascript (simplier than java)...

#3 ahmed17

ahmed17
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 09 October 2006 - 09:34 PM

thanks amalosoul  :)  i know javascript do that but how i use it with this script  to make wat i do ? ?

#4 ahmed17

ahmed17
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 10 October 2006 - 01:40 PM

what's the new to do ?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users