mysql 5.7 – Getting catagory title total number of questions and answers order by number of questions

I have three tables. Which is in at this fiddle,
http://sqlfiddle.com/#!9/46dfd6

Which is like this?.

CREATE TABLE `user_answers` (
  `id` int(250) NOT NULL,
  `question_id` varchar(250) NOT NULL,
  `user_id` int(250) NOT NULL,
  `answer` text NOT NULL,
  `date` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `user_questions` (
  `id` varchar(250) NOT NULL,
  `user_id` int(250) NOT NULL,
  `note_id` int(250) NOT NULL,
  `title` text NOT NULL,
  `question` text NOT NULL,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `material_univarcity_list` (
  `id` int(100) NOT NULL,
  `name` varchar(50) NOT NULL,
  `about` mediumtext NOT NULL,
  `date` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

I want to get a resultant table which has count – Name(Name is from material_univarcity_list) Total number of questions to that particular name. Here id of material_univarcity_list table is the note_id of user_questions and I want total number of answers to that particular catagory here question_id is the id of user_questions. How can I do this?

My expected result is like

no|catagory        |number_of_questions |number_of_answers
 1|DBMS 5th sem ISE|            2       | 3

How can i do this?

8 – How can I change the title for the page containing the node edit form?

Stack Exchange Network


Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

How to remove the content type part in a node-edit page title in Drupal 8?

Stack Exchange Network


Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

sharepoint online – Calculated Column and File Name ‘Title’ Field

I uploaded more the 2000 images files to an SP document library.

When I checked the ‘See Details’ under the file name property options, I noticed the actual name of the file appears in the “Name” field, but not the “Title” field. Why did SP add the name one place and not the other; especially if the content of “Title” is what an SP calculated column defaults to for calculations; which is my issue.

I now want to create a calculated column but the formula doesn’t work because there is no data in “Title”, and “Title” is the only column name option given to me when creating the calculated column.

The question also being asked, “why can’t I see/access ‘Name’ column” in the column options when creating the calculated column? That would fix everything.

Please advise.

enter image description here

database – How can I query by node title?

In Drupal 7 I had this code to query node fields and its respective title:

$query = db_select('node', 'n');
$query->join('field_data_field_internal_institute_paper_i', 'iipi', 'n.nid = iipi.entity_id');
$query->fields('n', array('nid'));
// some other conditions
$query->fields('n', array('title')); // <- working fine for D7
$result = $query->execute()->fetchall();

which was working fine. I know imported to D9 and I need to rewrite this accordingly:

$db = Drupal::database();
$query = $db->select('node', 'n');
$query->join('node_revision__field_internal_institute_paper_i', 'iipi', 'n.nid = iipi.entity_id');
$query->fields('n', array('nid'));
// some other conditions
$query->fields('n', array('title')); //<- not working for D9
$result = $query->execute()->fetchall();

for some reason array('title') isn’t a field anymore as seen above. How can I get the title here?

Why Google search result page has an "Ad Added" + number on the title of the result page?

I have encountered this situation a few times, it’s not happening every time, and finally, I got this screenshot:

enter image description here

It’s not just happening for my Chrome, but also for my brand-new installed Safari:

enter image description here

I even tried SERP checker. It’s still the same:

enter image description here

Has anyone seen this before? What is this for?

9 – How to query a node title by DB select in D9

In Drupal 7 I had this code to query node fields and its respective title:

$query = db_select('node', 'n');
$query->join('field_data_field_internal_institute_paper_i', 'iipi', 'n.nid = iipi.entity_id');
$query->fields('n', array('nid'));
// some other conditions
$query->fields('n', array('title')); // <- working fine for D7
$result = $query->execute()->fetchall();

which was working fine. I know imported to D9 and I need to rewrite this accordingly:

$db = Drupal::database();
$query = $db->select('node', 'n');
$query->join('node_revision__field_internal_institute_paper_i', 'iipi', 'n.nid = iipi.entity_id');
$query->fields('n', array('nid'));
// some other conditions
$query->fields('n', array('title')); //<- not working for D9
$result = $query->execute()->fetchall();

for some reason array('title') isn’t a field anymore as seen above. How can I get the title here?

server – Rsync re-transfers entire file after title change

According to rsync’s man page:

[Rsync] is famous for its delta-transfer algorithm, which reduces the amount
of data sent over the network by sending only the differences between
the source files and the existing files in the destination.

However, I noticed today that several video files that I had only changed the name of, were re-transferred in their entirety. This seems to contradict the above claim by rsync that it only updates the changes made. Have I made an error in my command that would cause a small text change to the title of a file to cause the re-tranfer of the entire file?

My command:

rsync -avz --delete -e ssh /files/tobe/transferrd server@1.1.1.1:/backup/location 1>>/logs/backup.log

filters – How to get title of images in post content

Today I have the function created below using regex that inserts the POST title if the ALT attribute of the image inserted in the content is empty.

But now I want to get the title of the image and not the post. How to make?

if( ! ( function_exists( 'add_alt_image_content' ) ) ) {
    function add_alt_image_content( $content ) {

        if ( is_single() && in_the_loop() && is_main_query() ) {

            global $post;

            $image = get_post( $post->ID );
            $image_title = $image->post_title;
    
            $pattern = '~(<img.*? alt=")("(^>)*>)~i';
            $replace = '$1'.$image_title.'$2';
            $content = preg_replace( $pattern, $replace, $content );
            
            return $content;
        }
    } 
}
add_filter( 'the_content', 'add_alt_image_content' );

title – How to tell the search engine to fill in the blanks?

To rank for a phrase in Google you generally have to use the words from the phrase on your page. So if somebody were searching for “a tree saved is a air earned”, then to rank for that phrase, you should use the phrase on the page, ideally in the title.

There are a few exceptions to this:

  • Google will substitute misspellings. If somebody searches for “a tre saved is a air earned”, Google will likely still recommend your page the ranks for the correct spelling.
  • Google will substitute synonyms. Your page may still rank for “a tree preserved is a air earned”.
  • Google often ignore unimportant words in a query so when somebody asks “What is a tree saved is an air earned?” Google will find the page that has just “tree saved air earned” on it.

Google puts a lot of emphasis on returning relevant results. They do not consider it a good user experience to show one page to a large variety of search terms that contain important terms not on the page.