S
S
Stacy None2018-12-20 02:43:08
MySQL
Stacy None, 2018-12-20 02:43:08

How to find and display cell values ​​from MySql database?

I have this sql query:

$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_complaint WHERE n_id='{$news_id}'" );
echo $row['count'];

Which, in theory, should look for the number of columns (complaints) in the _complaint cell and display the value.
How to wrap it in php correctly?
I tried, but knowledge is not enough:
<?php
if(!defined('DATALIFEENGINE'))
  return;

$newsid = isset($newsid) && intval($newsid) > 0 ? intval($newsid) : false;
if(!$newsid || $newsid < 1)
  return;
$count_rep = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_complaint WHERE n_id='{$news_id}'" );
echo $count_rep['count'];


?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question