How to set php mysql from javascript var or input type text ?
This is my php mysql code:
<?PHP
$count = 1;
$query = "SELECT * FROM user WHERE ORDER BY RAND()";
$result = mysql_query($query) or die(mysql_error());
while( ($row = mysql_fetch_array($result)) && ($count <= 36))
{
$uid = $row['uid'];
$count++;
}
?>
And this is my javascript for check clientwidth and set value into input type text
<input type="text" id="width"/>
<script>
var width=window.innerWidth || document.documentElement.clientWidth
document.getElementById("width").value = width;
</script>
I want to do like this
if var javascript width > 1599
i want to use this code php my sql
<?PHP
$count = 1;
$query = "SELECT * FROM user WHERE ORDER BY RAND()";
$result = mysql_query($query) or die(mysql_error());
while( ($row = mysql_fetch_array($result)) && ($count <= 40))
{
$uid = $row['uid'];
$count++;
}
?>
else width <= 1599
<?PHP
$count = 1;
$query = "SELECT * FROM user WHERE ORDER BY RAND()";
$result = mysql_query($query) or die(mysql_error());
while( ($row = mysql_fetch_array($result)) && ($count <= 36))
{
$uid = $row['uid'];
$count++;
}
?>
How can i do that?
thank you