Jump to content

[SOLVED] need help in php code


saad|_d3vil

Recommended Posts

hi i am new here first of all hi and i need help in php code i have just make table in database sql now what i put code for insert table in to website and other is that how i make hyper link for sql database table in php code

 

Translation:

Hi I am new here. First of all, hi and I need help with my php code. I just made a table in the database, how do I use the insert query on my website? Other question is, how do I make a hyper link to the database table in my php code?

 

I think that is what he is say...

Link to comment
Share on other sites

thi is my coding

<?php

$con = mysql_connect("localhost","apnimusk","password");

if (!$con)

{

die('Could not connect: ' . mysql_error());

}

 

mysql_select_db("my_db", $con);

 

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

 

while($row = mysql_fetch_array($result))

{

echo $row['name'] . " " . $row['age'];

echo "<br />";

}

 

mysql_close($con);

?>

i have put this code now i want to know how i make hyperlink so people who click on the hyperlink it goes to other table of my database but on same page but the id of the change

my website link is this http://www.apnimuskaan.com/sadasdas.php

Link to comment
Share on other sites

<?php
$con = mysql_connect("localhost","apnimusk","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("my_db", $con);

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

while($row = mysql_fetch_array($result))
  {
  echo $row['name'] . " " . $row['age'];
echo "<a href='?id='".$row['id']."'>".$row['name']."</a>'";
  }

mysql_close($con);
?>

Link to comment
Share on other sites

are you using the updated one

 

<?php
$con = mysql_connect("localhost","apnimusk","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("my_db", $con);

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

while($row = mysql_fetch_array($result))
  {
  echo $row['name'] . " " . $row['age'];
echo "<a href='?id='".$row['id']."'>".$row['name']."</a>'";
  }

mysql_close($con);
?>

Link to comment
Share on other sites

i write this code

<?php

$con = mysql_connect("localhost","apnimusk","password");

if (!$con)

{

die('Could not connect: ' . mysql_error());

}

 

mysql_select_db("apnimusk_naat", $con);

 

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

 

while($row = mysql_fetch_array($result))

{

echo $row['name'] . " " . $row['age'];

echo "<a href='?id='".$row['1']."'>".$row['age']."</a>'";

}

 

mysql_close($con);

?>

but it is not working see this page http://www.apnimuskaan.com/sadasdas.php

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • 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.