IndianaJoe

PHP Code with Custom Tables

Recommended Posts

I'm trying to use a simple lookup based on a value and am not getting anything returned from the query after a record is added.

//<?php

$team1Row = \IPS\Db::i()->select( 'primary_id_field, field_27', 'cms_custom_database_5', array( 'primary_id_field=?', $content->field_61 ) )->first();
$team2Row = \IPS\Db::i()->select( 'primary_id_field, field_27', 'cms_custom_database_5', array( 'primary_id_field=?', $content->field_63 ) )->first();

$newTitle = $team1Row->field_27." vs. ".$team2Row->field_27." winID: ".$content->field_61." loseID: ".$content->field_63;

return $newTitle;

Is this the right query structure to use?  The final output is " vs. winID: 8 loserID: 23" with the ID's being correct. The custom database has the field_27 also.

Thanks

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.