php - Grab a specific value from MySQL database -
I am trying to get a value from a MySQL database. I need to catch value for a special item and here's how my table looks:
I'm not sure how to go about this and only one thing that I think of getting value from the table Query where it only takes the result that matches domain_address
I type the function & lt ;? Php echo getPageURL () ;? & Gt;
which is http://voxhallpartswarehouse.co.uk/
(which should match the database entry.
// The table which calls the function Is & lt; td bgcolor = "# 999999" align = "center" & gt; Value: & lt;? Php echo getprice (?);? & Gt; & lt; php function getPrice ($ {$ Con = mysqli_connect ("host", "user", "pass", "db"); $ value = mysqli_query ($ con, "domain selection value domain WHERE domain_address = '& lt ;? php echo GetPageURL ();; & gt; ''); mysqli_close ($ con); return $ value; // domain_address unique}?
This does not want to work, and I really do not know How to get that value.
OK and I already have this code below the script which creates a table with all the results from the database, so maybe I do something with the code below
) {Echo "Failed to connect to MySQL:". Mysqli_connect_error (); } $ Result = mysqli_query ($ con, "select domain_name, domain_edder, price from domain"); Echo "& lt; Table border = '1' & gt; & lt; tr & gt; & lt; th & gt; Domain & lt; / th & gt; .... & lt; / tr & gt; ; While ($ line = mysqli_fetch_array ($ result)) {echo "
That's because in this line:
$ Value = mysqli_query ($ con, "WHERE domain_address = '& lt ;? php echo getPageURL ();; & gt;' ') from the selection price domain;
GetPageURL ()
is not executed, it is just a fixed part of the entire string. Try it:
$ value = mysqli_query ($ con, "domain select domain Domain name from "". GetPageURL (). "'");
Comments
Post a Comment