Jump to content

Print php script result in html page


aashcool198

Recommended Posts

This code prints skills in hierarchical form means

 

Parent skill

  its child skill

  its child skill

  its child skill

Parent skill

its child skill

its child skill

its child skill

.

.

.

.

.

so on..

 

Now the list can be any long. Now i want to insert one parent and its children on a specified place in my html page. basically i want one set to be shown in one column of html table and other set in next column.

Can i use

 

$html = file_get_contents("test.html");

$replaceThis = array( '{NAME}', '{JS}');

$replaceWith = array( $name,'<script language="JavaScript" >')

 

$html = str_replace($replaceThis, $replaceWith, $html);

echo $html; 

 

if yes then how for this dynamically changing content.

 

 

 

<?php

$conn = mysql_connect('localhost', 'root', '') or die(mysql_error());
mysql_select_db('Sumeru Skills', $conn);


$result = mysql_query("SELECT * FROM person_skills");

while($row = mysql_fetch_array($result))
  {
  $skill_id = $row['skill_id'];
  


     $result2 = mysql_query("SELECT * FROM skills where skill_id = $skill_id && parent = 'm'");                                                                              

 while ($row2 = mysql_fetch_array($result2)){

 echo $row2['skill']."  ".$row['lev_exp']."</br>";
}

$result1 = mysql_query("SELECT * FROM skills where parent = $skill_id"); 

while ($row1 = mysql_fetch_array($result1)){

echo $row1['skill']."</br>";
}


}



?>

Link to comment
https://forums.phpfreaks.com/topic/160333-print-php-script-result-in-html-page/
Share on other sites

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.