NameSilo

Pulling from sql database

Spaceship Spaceship
Watch

goodguyright

Established Member
Impact
0
I am trying to add a line of info that a visitor sees on my website.

The first line below works great. I simply copied the line, changed the information that is in the sql database and lo and behold...the data doesn't appear. The name Site: appears, but nothing from the sql.

What could I add or change to make this work?
Is there another way of accessing the data and then displaying it that would work as well or better then the method below?

<p class="byline"><small><strong>Category:
</strong>{$dataPost.post_cat_name}</a></small></p>

<p class="byline"><small><strong>Site:
</strong>{$dataPost.post_site_name}</a></small></p>


Thanks for helping me out.

Craig
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
can you please post more of the script, such as the $datapost info..
 
0
•••
Here is the script for the section that I can't get to work.

the line with site: is the part that is not displaying the data from the database.


<div style="width:550px" id="feature" class="box-orange">
<h2 class="section"><b>Details</b></h2>
<div class="content">
<h1>{$dataPost.post_title}</h1>
<p class="byline"><small><strong>Category: </strong><a href="{$dataPost.post_cat_url}">{$dataPost.post_cat_name}</a></small></p>
<p class="byline"><small><strong>Site: </strong>{$datapost.post_feed_title}</a></small></p>
<p class="byline"><small><strong>Publish Date: </strong>{$dataPost.formated_post_pubdate}</small></p>
<br />
<p>{if $dataPost.post_description==''}
No data available.
{else}
{$dataPost.post_description}
{/if}
</p>
<br />
<p><a href="{$dataPost.post_link}"><strong>Continue to Site ></strong></a></p>
</div>
</div>
 
0
•••
That looks like it may be from a premade script (i don't often see the use of curly script and var names like $datapost.post_title unless it's a premade script). what are you running?
 
0
•••
Are you sure $dataPost.post_site_name equals anything? This variable refers to a column/value pair pulled from a SQL statment. Only if the SQL statment actually pulled the post_site_name and that value actually exists in your DB will it show.
 
0
•••
type of script

nasaboy007 said:
That looks like it may be from a premade script (i don't often see the use of curly script and var names like $datapost.post_title unless it's a premade script). what are you running?


It is an RSS script that I purchased here on NP.

Unknown said:
Are you sure $dataPost.post_site_name equals anything? This variable refers to a column/value pair pulled from a SQL statment. Only if the SQL statment actually pulled the post_site_name and that value actually exists in your DB will it show.



I haven't tried breaking the script to see where it might be pulling from.

I'll give that a shot, but that piece does seem to work.

What I want to do is the same thing, only pull and display different data.

Any suggestions?
 
0
•••
if you want to pull different display you may have to edit the php (find the query where it reads the database) and change that around... it's difficult to debug without looking at the actual code.
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back