Jump to content

values one table value stored in another table


veluit06

Recommended Posts

hi

i design a database for link submission, one table value stored in another table

 

below is my queries

 

<?php

$operation = $_GET['Opr'];

$linka=$_GET['linka'];

 

if($operation=="saveLink")

{

$con = mysql_connect("localhost","root");

mysql_select_db("linksubmit", $con) or die( "Unable to select database");

$query = "INSERT INTO links VALUES('$linka')";

mysql_query($query);

mysql_close();

 

echo ("Link Submited Successfully For UnionShoppe");

 

}

 

else if ($operation=="cUnion")

{

 

mysql_connect("localhost","root");

mysql_select_db("linksubmit") or die( "Unable to select database");

$num = 0;

$query="SELECT * FROM links WHERE (linka = '$linka')";

$result=mysql_query($query);

$num = mysql_numrows($result);

mysql_close();

}

echo $num;

?>

 

next table

 

<?PHP

$operation = $_GET['Opr'];

$linkchrist=$_GET['linkchrist'];

 

if($operation=="saveChrist")

{

$con = mysql_connect("localhost","root");

mysql_select_db("linksubmit", $con) or die( "Unable to select database");

$query = "INSERT INTO christ VALUES( '$linkchrist')";

mysql_query($query);

mysql_close();

 

echo ("Link Submited Successfully For mychristmasgiftz");

}

 

else if ($operation=="cchristLink")

{

 

mysql_connect("localhost","root");

mysql_select_db("linksubmit") or die( "Unable to select database");

$n = 0;

$query="SELECT * FROM  christ WHERE(linkchrist = '$linkchrist')";

$result=mysql_query($query);

$n = mysql_numrows($result);

mysql_close();

}

echo $n;

 

 

?>

 

where i have to concentrate, this query is correct, am using ajax

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.