veluit06 Posted January 2, 2009 Share Posted January 2, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/139178-values-one-table-value-stored-in-another-table/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.