Note that there are some explanatory texts on larger screens.

plurals
  1. POcarrying a form value into another webpage using PHP
    primarykey
    data
    text
    <p>I know asp can carry over the form value and plug it into another linked page. Is there a way to do this with PHP PDO script. For example, I have a new table entry on my mock site for each new member. For each record a form button called "member profile" is created that has the value of the member in that same row. When I click the button I want the member name to carry to a new page and link to that phpmyadmin table and display all of the date for that member. I hope I explained that right. and here is my code</p> <pre><code>$dsn = 'mysql:host=localhost;dbname=averyit_net'; $db_username = "root"; $db_password = "password"; $db = new PDO ($dsn, $db_username, $db_password); $tablemaker = $db-&gt;query("SELECT `cust_profile`.`CustomerName`, `cust_profile`.`CustomerType`, `cust_profile`.`ContractHours` FROM `cust_profile` ORDER BY `CustomerName`"); while ($rows = $tablemaker-&gt;fetch(PDO::FETCH_ASSOC)) { ?&gt; &lt;table width="75%" border="1" cellspacing="0" align="center"&gt; &lt;th width="15%" height="0%" bgcolor="#819FF7"&gt; &lt;/th&gt; &lt;th width="35%" height="0%" bgcolor="#819FF7"&gt; &lt;/th&gt; &lt;th width="30%" height="0%" bgcolor="#819FF7"&gt; &lt;/th&gt; &lt;th width="20%" height="0%" bgcolor="#819FF7"&gt; &lt;/th&gt; &lt;tr&gt; &lt;form method="post" action="edit_cust.php" &gt; &lt;td align="center"&gt; &lt;span style="font-size: 9pt"&gt;&lt;font size="1" face="Verdana"&gt; &lt;input TYPE="submit" NAME="dothis0" value="Customer Profile"&gt; &lt;/font&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt; &lt;/font&gt; &lt;input type="hidden" name="custID" value="&lt;?php echo $rows['CustomerName']; ?&gt;"&gt; &lt;/font&gt; &lt;/td&gt; &lt;/form&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload