IT.COM

I'm about to go insane

Spaceship Spaceship
Watch
Impact
20
PHP:
<?
include("config.php"); 
$select = "SELECT * FROM `news` WHERE id = '$id'";
$result= mysql_query($select); 
while($data = mysql_fetch_array($result)){
$id= $data["id"];
$newstitle= $data["newstitle"];
if (@!$my_notes){
$my_notes = "No Notes Where entered";
}
}
?>

<html>
<head>
<title>arrghh</title>
</head>
<body>
<? echo $newstile; ?><br>
</body>
</html>


:cries:

anyone tell me whats wrong with this code?

if i go to news.php?id=1 nothing works but if its changed to this all to this

PHP:
<?
include("config.php"); 
$select = "SELECT * FROM `news`";
$result= mysql_query($select); 
while($data = mysql_fetch_array($result)){
$id= $data["id"];
$newstitle= $data["newstitle"];
if (@!$my_notes){
$my_notes = "No Notes Where entered";

}
}
?>

<html>
<head>
<title>arrghh</title>
</head>
<body>
<? echo "$id <br> $newstitle" ?><br>dsfasdfasdfasdf
</body>
</html>


it selects the values but it doesnt work with the ?id=1


:cries:
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Hey I see one reason why you may not get any results on your first example, you have $newstile and I think it should be $newstitle. :)

I'm a novice when it comes to MySQL coding, but why do you have the back-ticks around your table names in your SELECT query? Those aren't needed are they? Just wondering. :D
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back