Jump to content

Search the Community

Showing results for tags 'php array'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. hi, I've got a variable being passed to me from a third party website. in the following format "45-1," where 45 would be the item id and 1 would be the quantity. the variable could hold a few key pairs. eg: "45-1,46-3,5-3,"the first number is always the item id and the 2nd number is always the quantity. each pair separated by a comma. there is always a trailing comma. I need to deconstruct these pairs and deduct the quantity from the correct item in the products table in my database. My question is, what is the best way to deconstruct these pairs?im guessing I should put these in to an array.not totally sure how to do this. any help or ideas would be great. the variable is initially set like this: $custom = $_POST['custom'];
  2. how to use array to echo result in specific field <?php //$conn=mysql_connect("localhost", "root", "");//$db=mysql_select_db ('geotex', $conn) or die (" error "); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title></head> <body> i have "perosn" table in database "geotex" with 3 fields ###### age and person date in table like tis ###### name age </br>male abc 33</br>male xyz 2</br>female 123 25 <form action="person.php" method="post"> <table width="299" border="0" cellpadding="3"> <tr> <td width="109"><div align="center">######</div></td> <td width="107"><div align="center">Name</div></td> <td width="57"><div align="center">Age</div></td> </tr></table> <table width="200" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="62"><div align="center"> <input name="######[]" type="text" size="20 " /> </div></td> <td width="62"><div align="center"> <input name="name[]" type="text" value= "<?php // i set value here for this field if (isset ($_POST['select'])) {$sql = "select * from person where ###### = 'male' "; $run = mysql_query($sql); while ($result = mysql_fetch_array($run)) {echo $name = $result ['name'];} // echo shows both abc and xyz but i wanna show abc name using array position }?>" size="20 " /> </div></td> <td width="88"><div align="center"> <input name="age[]" type="text" value= "<?php if (isset ($_POST['select'])) {$sql = "select * from person"; $run = mysql_query($sql); while ($result = mysql_fetch_array($run)) {echo $age = $result ['age'];} // echo shows both 33 and 2 but i wanna show abc age using array position }?>" size="10" /> </div></td> </tr> <tr> <td width="62"><div align="center"> <input name="######[]" type="text" size="20 " /> </div></td> <td width="62"><div align="center"> <input name="name[]" type="text" size="20 " /> </div></td> <td width="88"><div align="center"> <input name="age[]" type="text" size="10" /> </div></td> </tr> </table> <table width="200" border="0" cellpadding="3"> <td width="134"><div align="center"> <input name="select" type="submit" value="SELECT" /> </div></td> </table> </form>i wanna show result with array position mean in first row i need abc in name filed 33 in age field and male in ###### field and xyz in second row as well </body></html>
×
×
  • Create New...