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 " tr <"; Echo "& lt; td & gt;" . $ Line ['domain_name'] "& lt; / td & gt;"; Echo "& lt; td & gt; & lt; a target = '_ blank' href =". $ Line ['domain_advertiser'] "& gt;" .... // mysqli_close ($ con); ? & Gt;

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

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -