PHP SQL in wordpress

Thanks for any help in advance
i have a site that im trying to add features in but im not that good with php yet... my normal coding language is coldfusion.

what im trying to do is get my image slider on my front page to look like the posted image which i have but the only thing i cannot get is the price from the database to display as well... mainly because i dont understand the relationship between the post and postdata tables....

so what i need is some help to write the code that with get the price and display it on top of the images that rotate every 5 secs on my front page....

also, wordpress makes the php code very confusing for me.... am i just really crap at php or is wordpress really advance php??? or just confusing to everyone lol..

please any help would be wonderful...

 mul23072-wrdp2--1-.xls  template-front.php image of what the page needs to look like
LVL 1
Rcollins207Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jrm213jrm213Commented:
Hi,

If the price is in a custom field as part of each post, you get it using the function get_post_custom http://codex.wordpress.org/Function_Reference/get_post_custom

It looks like the excel that you attached is the posts table, the price data should not be in there. The only other thing I could think is that the price data is in a separate table. How does it get entered?

0
Rcollins207Author Commented:
a custom field... but the price data is in the other tab in excel called postdata which is the other table..... and i kinda need help with the code as i suck at php sorry
0
jrm213jrm213Commented:
I think you could replace:

<?php echo "<h1>testing</h1>"; ?>

with

<?php
$key = "name_of_your_custom_field";
$custom_values = get_post_custom_values($key, get_the_ID());
//I am going to guess you only have one value for the key, but just in case...
 foreach ( $custom_values as $key => $value ) {
    $myvalue = $value;
  }
//maybe do a check to make sure value is what you expect, then if it is echo it out...
echo($myvalue);
?>
0
jrm213jrm213Commented:
it looks like you could also use get_post_meta($post_id, $key, $single); http://codex.wordpress.org/Function_Reference/get_post_meta

so

instead of

<?php echo "<h1>testing</h1>"; ?>

you could try:

<?php echo(get_post_meta(get_the_ID(), 'price', true)); ?>


Wordpress just has things encapsulated for you, so you need to find the function that gets what you want. You could write your own function to connect and query the database, but they already have the functions in place for you.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rcollins207Author Commented:
ty
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.