Jump to content

PHP mysql selec help needed


Paldo

Recommended Posts

Well tahnks I did this:

 

$result = mysql_query("SELECT account_number FROM database") or die(mysql_error());

$balance = mysql_result($result, 0, "account_numer");

 

echo $balance

 

and it's working. BUT  one last thing I would like to ask. What is  a correct way to send value of this $balance to another page so I can use it there????

 

 

I tried : echo'<a href="http://parobek.euweb.cz/transfer.php?t=$balance">Prevody</a>'; 

 

but when I echo t  on second page it prints $balance not the value of it. 

 

Thanks

 

Hey! Shame on me that I'm putting this question on you, but I just cant solve it and I'm realy desprete by now...

 

it says: Parse error: parse error, expecting `','' or `';'' in /3w/euweb.cz/p/parobek/welcome.php on line 31

 

<html>

<body>

<?php

 

if ($name=="admin" && $password=="adnddnd" )

    { print "welcome Admin /n";

      echo'<a href="http://parobek.euweb.cz/new.php">Creating new customer</a>';

 

echo'<a href="http://parobek.euweb.cz/zmena.php">Information update</a>';

echo'<a href="http://parobek.euweb.cz/odstran.php">to delete a customer</a>';

     

}

else { $con = mysql_connect("mysql.webzdarma.cz","parobek","adnddnd");

if (!$con)

  {

  die('Could not connect: ' . mysql_error());

  }

 

mysql_select_db("parobek", $con);

 

$result = mysql_query("SELECT * FROM Customers WHERE Login='$meno' AND pasword='$heslo'");

 

while($row = mysql_fetch_array($result))

  {

  echo $row['Name'] . " " . $row['Login']. " " . $row['Password']. " " . $row['accountID']. " " . $row['balance'];

  echo "<br />";

 

$resul = mysql_query("SELECT stav FROM Customers WHERE Login=$name ") or die(mysql_error()) ;

$balance = mysql_result($resul, 0, "balance");

 

echo'<a href="http://parobek.euweb.cz/transfer.php?t='$balance'">Transfers</a>';

  }

echo $balance;

mysql_close($con);

 

}

?>

</body>

</html>

Well thanks that worked well. I moved a bit further...

Yet something always not working. As I try to finaly use the transfered variable on a target site it says:

 

Parse error: parse error in /3w/euweb.cz/p/parobek/transfer.php on line 16

 

<html>

<head>

</head>

<body>

 

<font size="12" color="red" face="Arial, Helvetica">Zadajte cislo uctu kam previest zdroje</font>

 

<form action="http://www.parobek.euweb.cz/transferconfirm.php" method="post">

 

Cislo uctu: <input type="int" name="cisuctu" /><br />

Ciastka k prevodu: <input type="int" name="prevod" />

<input type="submit" />

</form>

 

<?php

$balance = $_GET['t']';

echo $balance;

 

?>

 

</body>

</html>

 

I realy don't know whats wrong with it... If you have a minute to ceck it out I would be thankfull...

Sorry, I didn't see in your original code that you were echoing your link with single quotes.

 

Change this:

 

 

echo'<a href="http://parobek.euweb.cz/transfer.php?t='$balance'">Transfers</a>';

 

to this:

 

echo'<a href="http://parobek.euweb.cz/transfer.php?t='.$balance.'">Transfers</a>';

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.