dont know if it works! help
Posted: Fri Nov 06, 2009 7:57 am
Hi i got a code that i dont know if its possible to work or not
i need to get a units from a specific row and a Buyfor at the same and so on but then i need to get same info but on a diffrent row...
my idé were this but it dont work as i want it to...
my first php script is for that i said...
my second php scripthing is to get a specifik row in a diffrent datatable in the database that i get to work
well im wondering if its possible to have 2 php scripts like this without them bothering each other and plz tell me if i got anything wrong in php script 1 as its a code i cant get to work
thanks for all the help
-Thomas
i need to get a units from a specific row and a Buyfor at the same and so on but then i need to get same info but on a diffrent row...
my idé were this but it dont work as i want it to...
my first php script is for that i said...
my second php scripthing is to get a specifik row in a diffrent datatable in the database that i get to work
well im wondering if its possible to have 2 php scripts like this without them bothering each other and plz tell me if i got anything wrong in php script 1 as its a code i cant get to work
Code: Select all
<?php
include "../login/database.php"; //page to where the database setting is
$sql="SELECT * FROM units"; //selecting all from DB "Konto" where saved_id is the same as in the array $id
$result = mysql_query($sql) or die(mysql_error());//Välj all info i tall. //hämtar all info från tabell
while($row = mysql_fetch_array( $result )) //hämtar info från tabell.
{
$Units1=$row['Units']"' WHERE saved=1"; // i got a row in my Tabledata called saved with the number 1 in.
$AtkArm1=$row['AtkArm']"' WHERE saved=1";
$Buyfor1=$row['Buyfor']"' WHERE saved=1";
$Sellfor1=$row['Sellfor']"' WHERE saved=1";
$Units2=$row['Units']"' WHERE saved=2";// i got a row in my Tabledata called saved with the number 2 in.
$AtkArm2=$row['AtkArm']"' WHERE saved=2";
$Buyfor2=$row['Buyfor']"' WHERE saved=2";
$Sellfor2=$row['Sellfor']"' WHERE saved=2";
$Units3=$row['Units']"' WHERE saved=3";// i got a row in my Tabledata called saved with the number 3 in.
$AtkArm3=$row['AtkArm']"' WHERE saved=3";
$Buyfor3=$row['Buyfor']"' WHERE saved=3";
$Sellfor3=$row['Sellfor']"' WHERE saved=3";
}
exit;
?>
<?php
$id =(isset($_GET['saved_id'])) ? (int)$_GET['saved_id'] : false;
if($id !== false) {
$sql="SELECT * FROM inventory WHERE saved_id=$id"; //selecting all from DB "Konto" where saved_id is the same as in the array $id
}
else
{
echo "NO saved_id!";
}
$result = mysql_query($sql) or die(mysql_error());//Välj all info i tall. //hämtar all info från tabell
while($row = mysql_fetch_array( $result )) //hämtar info från tabell.
{
$namn=$row['namn'];
}
?>
thanks for all the help
-Thomas