I have 2 MySQL Databases and I want to link them together.
What I am trying do is when you brin up a record say record ID in one DB is RMA-4598 and in the other the record ID is 4598. What I want to do is Strip the RAM- off so im left with 4598 and have the 4598 place into a mySQL query string
PHP Code:<?
mysql_connect("localhost","root","rootpass");
mysql_select_db("service");
if($_GET["cmd"]=="view" || $_POST["cmd"]=="view")
{
$id = $_GET["id"];
$sql = "SELECT * FROM service WHERE id=$id";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
}
?>
The RMA field for the DB code above isSo i want to strip RMA- from the SVC number and use it as the ID for another DBPHP Code:<?php echo $myrow["svc"] ?>
Once i get that down i should be able to load the Data From both DB's and display on screen.PHP Code:<?
mysql_connect("localhost","root","rootpass");
mysql_select_db("service");
if($_GET["cmd"]=="view" || $_POST["cmd"]=="view")
{
$id = $_GET["id"];
$sql = "SELECT * FROM rma WHERE id=$id";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
}
?>



Reply With Quote

Bookmarks