ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

SQL DB count entries and put variable

Draeke 07 Jan, 2021
Hello

I want to count certain entries from the database and deactivate input fields based on the output.
The "input" tag is not the problem. But I don´t know where I have to put the sql code (incomplete)!?
$sql = "SELECT COUNT(row) FROM db WHERE xy='yx'";
if ($result = mysqli_query($db, $sql)) {
$row = mysqli_fetch_row($result);
$count = $row[0];
<input type="radio" id="id" name="name" value="value" <?php if($count >= $int){ echo "disabled";} ?> >
Max_admin 09 Feb, 2021
did you manage to solve this ?
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Draeke 09 Feb, 2021
Yes!
Action -> Read Data -> Query Fields -> COUNT(radio name) and WHERE command
then
HTML with php: ... $count1 = $this->get("field alias from read data"); ...

For me the best solution
Draeke 09 Feb, 2021
Answer
COUNT(column name)
You need to login to be able to post a reply.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com