Jump to content

Paldo

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Everything posted by Paldo

  1. ok I change it to a form you can see above but now it say : Parse error: parse error, expecting `')'' in /3w/euweb.cz/p/parobek/zuzkeconfirm.php on line 29 what is actualy the line with the condition...
  2. Hi guys! Could you please look at this if it could work somehow couse it's not working... Thanks <html> <body> <?php $NumberInStringFormat = $_POST[number]; echo $NumberInStringFormat; echo '<br>'; $lenght = strlen($NumberInStringFormat); echo $lenght; $IdetificatorArray = array( "1" => "ones" , "2" => "tens" , "3" => "hundreats" , "4" => "tousands" , "5" => "tentousands" , "6" => "houndrettousands" , "7" => "milions" , "8" => "tenmilions" , "9" => "houndretmilions" , "10" => "bilions" ); for ($i = $lenght ; $i = 0; $i-- ) { $valueArray = array( '$IdetificatorArray[$i]' => '(int)$NumberInStringFormat($i)' ); } print_r($valueArray); //1 364 720 434 ?> </body> </html> PS: What I was trying to do is get a array, for example if imput $numberInStringFormat is 345 the array should look like this: [hundreats] => 3; // all of these in int format... [tens] => 4; [ones] => 5;
  3. Could you be more specific please? Becouse What I originaly need to do is to transfer either string entred number or int into verbal form, for example 1874 ----> one thousand eight hundreat seventy four, and I have a strange feeling that there is som easy way to do that, however I'm not very good with maths. thanks
  4. Hi ! I want to ask you If its possible to transfer int to array somehow so I can work with seperate digits from this integer. I was thinking if there is some conversion Int to string, first couse I recall some command like this from other programing language and maybe it could be first step to do maybe, maybe not. What I need is a way to analyze digit, for example 136245 I want to know how many tousants are there how many hundrets and so on... This is the reason why I'm thinking about putting this numbers into array. I hope I made my selfe clear somehow.
  5. Wow man you are some kind of genius or what ?!? Thanks a lot. A LOT!
  6. Great! Thanks! But why its printig $balance instead of value a was trying to transfer from first page?
  7. 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...
  8. 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>
  9. 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
  10. Hi I would like to ask how to select only one thing from database co I can use it later on. I have a databaze containing name, login, password, account number, balance. What I need is get only account number and store it to variable, for example $balance. How can I do this. Thanks
  11. Well thanks but I realy don't know how to use MySql and I would rather use somethin easier...
  12. no it's not real it' s a school project no money in stake
  13. First of all thaks a lot for every info so far... I guess I should be more specific. What I need is get a integer that represents a bank balance of customer from a database, store it to a variable for exemple $balance. This should be happening on the first page and I think it's not problem to do for me. On second page I want to use this integer to see if user can transfer some amount of money and in second step decrese his curent balance. Big deal for me is hov to transfer this balance. I hope I made my selfe clear. Thanks for all your help.
  14. Hi guys I know that this is probably too easy for you but... How can I move a value from one site to another for exapmle via link? or is there any othre way? For example I have $information in site welcome.php and I want to use it in site transfer.php. What is the best way to do this?
  15. Yeah I just did it and it works thank you all. Thank you very much.
  16. ok I added the or die(mysql_error()); now it says: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Zakaznici' SET balance= balance + 800 WHERE accountNumber= 1001' at line 1 So it can take numbers (800 and 1001 ) that is what I submited on previous page. ???
  17. Ok so I chnged it to this: <html> <body> <?php $con = mysql_connect("mysql.webzdarma.cz","parobek","adnddnd"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("parobek", $con); mysql_query(" UPDATE 'Customers' SET balance= balance + $_POST[transfer] WHERE acountNumber= $_POST[acountID] "); mysql_close($con); ?> </body> </html> // But still not working ... Somebody could help me pls?
  18. Ok lads I solved the problem with adding nonsens to database, it was my mistake couse I wrote incorect site name in form soruce site... I'm still in trouble though. Now it does nothing. I checked the link you posted. Thak you but maybe becouse of me it didn't help me much. Could you be please more specific about executing query. Im still not getting it. Thank you very much
  19. What it does is it adds a new record to database containing only accountID that is even the same as one already existing (the one that the transfer should go to ) and zero balance. If I'm not executing query what should I use to do this? Thanks
  20. <html> <body> <?php <?php $con = mysql_connect("mysql.webzdarma.cz","parobek","adnddnd"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db(("parobek", $con); $sql=(" UPDATE Customers SET balance= balance + $transfer WHERE cisuctu= $accountID "); mysql_close($con); ?> </body> </html> // $transfer and $acountID are variables posted from a form from previous page...
  21. Hi! I originaly wanted to use form post metod to update integer value in my database. I tried to use $sql=(" UPDATE Customers SET balance= balance + $trasfer WHERE userID = $usID "); but it's was not workin. Later on with no succses of solving this I reduced formulation of query just to try it to : $sql=(" UPDATE Customers SET balance= 200 WHERE balance = 500 "); and guess what - NOT WORKING. when I test this query in phpMyAdmin it's working. The problem is only when I try to use it in PHP. I was able to use stuff like INSER or SELECT in PHP with no problem but with this one I'm realy despred. Please help.... Thanks
×
×
  • 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.