Jump to content

what sort of goin is it cheers.


redarrow

Recommended Posts

 

i was just inplementing a blog system and i needed to get information

from one select staement from the same one so i got it going.

 

can you tell me why it works please cheers.

 

 

<?php session_start();

$query="select * from blogs where date_added=".$_GET['date_added']." and id=".$_GET['id']." ";


$result=mysql_query($query);

while($rec=mysql_fetch_assoc($result)){

// echo what ever

}

$query="select * from blogs where date_added=".
$_GET['date_added']." and id=".$_GET['id']." ";


$result=mysql_query($query);

while($rec=mysql_fetch_assoc($result)){

?>
<?php

$select1=" select * from blog_comments";

$t=mysql_query($select1);

while($m=mysql_fetch_assoc($t)){

$select=" select * from blog_comments where user_blog_id='".$rec['id']."'
and user_blog_date='".$rec['date_added']."'
and  date_added='".$m['date_added']."' and id='".$m['id']."' ";

$res=mysql_query($select);

while($dat=mysql_fetch_assoc($res)){

echo $dat['blog_comment'];
}
  }
   }
    }
?>

Link to comment
https://forums.phpfreaks.com/topic/43051-what-sort-of-goin-is-it-cheers/
Share on other sites

The reason for exec the script twice is becouse this is not the whole code ok the code is 1500 lines long ok, What you can see is the in and out of php for html.

 

And yes i wrote the code.

 

And how can there be any database attacks when the $_GETS[''] are all fully protected with a condition ok.

 

only want to no what sort of sql statement this is?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.