Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not entirely clear what problem you're having, but I'm assuming you want to do the calculation on the server (rather than in the browser), and perhaps save the multiplied value back to the database, and you're having issues getting the user-inputted value to your PHP code? Sorry if I've misunderstood - you might want to clarify your question a little if I have.</p> <p>It looks like your code emits a single row of an HTML table containing some links to other PHP scripts, but it doesn't contain a form. You should place your input inside a form, set it's action attribute to the appropriate script (e.g. <code>action='updatesales.php?id='.$row['id']</code>) &amp; its <code>method="post"</code>, and replace the link you emit on line 66 with a submit button (<code>&lt;input type="submit" value="update" /&gt;</code>, also inside the <code>&lt;form&gt;</code>).</p> <p>This will mean when you click the submit button, an HTTP POST will be sent to your updatesales script. You can then access the value of the textbox (if you're using a web framework, it may have its own preferred way of doing this; if not, you can use <code>$_POST['multiply']</code>). That value will be a string, so you'll probably want to convert it with <code>intval()</code> or <code>floatval()</code>. </p> <p>At that point, you can perform the multiplication and do whatever you need to with the resulting value - I'm not entirely clear what that is from your question.</p> <p>(As an aside, the HTML being echo'ed out looks invalid - I think there are a few <code>&lt;/div&gt;&lt;/td&gt;</code> that don't need to be there)</p>
    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.
    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