Jump to content

Fixing an IPB Pages Script


Phillyman

Recommended Posts

Posted

I had a script that went into my IPB Pages Database and brought back a list of records that met the query. I forget what version of IPB I upgraded to in the past that broke it. Anyone see what is wrong? Willing to pay to resolve.

$con=mysqli_connect("localhost","database","password","username");
// Check connection
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con,"SELECT `field_21`, `field_24`, `field_25`  FROM `ibf_ccs_custom_database_5` WHERE `field_77`='s' AND `field_129`='' AND `record_approved`='1'
ORDER BY `ibf_ccs_custom_database_5`.`field_21` ASC");

while($row = mysqli_fetch_array($result)) {
  echo $row['field_21'] . " " . $row['field_24']. " " . $row['field_25'];
  echo "<br>";
}

mysqli_close($con);

 

Results in...

image.thumb.png.797125fcdd37d3149bcc062467cec90c.png

Posted (edited)
11 minutes ago, Nathan Explosion said:

Lots is wrong.

Instead of trying to fix the script (which dates from the IPB 3.x days), why not state what the intention of the script is? Then someone might be able to help out.

I have a magazine database, it contains many fields.

Name, Month, Year, Status, etc

I want my members to be able to go to specific pages and pull back predefined queries. Any example would be something like "Magazines from the USA that are missing cover scans" or "Magazines that are currently missing"

At the present, if a user wants to find this information, they have to go page by page and record by record, I just want to have some predefined SQL queries, that users can go to that IPB page, and get back a list of records.

  • [image] - Name - Month - Year - Country - Status - Hyperlink to Record
  • [image] - Name - Month - Year - Country - Status - Hyperlink to Record
  • [image] - Name - Month - Year - Country - Status - Hyperlink to Record
  • [image] - Name - Month - Year - Country - Status - Hyperlink to Record

 

image.png.6075d33f9f73f7c13e84911ce612268f.png

Edited by Phillyman
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...