User:Abra Saghast/sandbox: Difference between revisions

From Greyhawk Wiki
Jump to navigation Jump to search
fiddling with PHP for Zavoda Index
 
m Anitar82 moved page User:Icarus/sandbox to User:Jawal Severnain/sandbox: Automatically moved page while renaming the user "Icarus" to "Jawal Severnain"
(No difference)

Revision as of 12:39, 7 February 2022

<?php

   # Get database connection
   $servername = "localhost";
   $username = "legionxi_indexer";
   $password = "zavoda";
   $dbname = "legionxi_zindex";
   // Create connection
   $conn = new mysqli($servername, $username, $password, $dbname);
   // Check connection
   if ($conn->connect_error) {
       die("Connection failed: " . $conn->connect_error);
   } 
   $wikitext =;
   $title = strreplace(, ' ', $wgTitle); #Replace the underscore with a space for the Title
   $sql = "SELECT 'Topic, Type, Product, Page/Card/Image' FROM table WHERE character_name ==".$title. " ORDER BY book_title DESC";
   $entries = $conn->query($sql);
   $wikitext = $title;
   foreach( $recentStats as $row){
       $wikitext .= "|- \n |" . $row->status . "\n |" . $row->book_title . " \n |" . $row->pages. " \n";
   }
   $conn->close(); 
   return $wikitext;