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

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.