Jump to content

how to convert following piece of code into smarty code


srinivasa

Recommended Posts

<?php

//db configuration

include "config.php";

 

if(!($db = @mysql_connect($server, $db_user, $db_pass))) //connect to database

die("Couldn't connect to the database.");

if(!@mysql_select_db($db_name, $db)) //select database

die("Database doesn't exist!");

 

$sql = "SELECT * FROM users";

 

if(($result = @mysql_query($sql, $db)) == 0)

{

echo "n<hr />Database error: <span>".mysql_error()."</span><br/>n";

die("MySQL Said: " . mysql_error());

}

 

$user = array();

 

?>

<table>

<tr>

<td><b>Name</b></td><td><b>Lastname</b></td>

</tr>

<?php

while($tmp = mysql_fetch_assoc($result))

 

{

?>

<tr>

<td><?php echo $tmp["Name"];?></td><td><?php echo $tmp["Lastname"];?></td>

</tr>

<?php

}

?>

 

 

 

 

plzzzzzzzzzzzzzzzzzzzzzzzz, reply soon

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...