0

I have a question about use the getElementById in php.

$tile = "<script>document.getElementById('selRow0').value</script>";
$height = "<script>document.getElementById('height0').value</script>";
$width = "<script>document.getElementById('width0').value</script>";

Make a SQL query in php

mysql_connect("localhost", "root", "root") or
die("Could not connect: " . mysql_error());
mysql_select_db("partition");
$query = "SELECT `Price` FROM `database` WHERE `Material ID` IN (SELECT `Material_ID` FROM `material` WHERE `Tile` = '$tile') AND  `Width_Height ID` IN (SELECT `Width_Height ID` FROM `width_height` WHERE `Width` ='$width' AND `Height` ='$height');";

It doesn't run the code, why?

user1978142
  • 7,946
  • 3
  • 17
  • 20
Alex_OX_17
  • 37
  • 7

1 Answers1

-2

You are mixing 2 separate languages.

To select DOM elements with PHP use DOMDocument Class

Szymon Toda
  • 4,454
  • 11
  • 43
  • 62