php - button with 2 variables, 1 each from 2 different mysql tablesGet the solution ↓↓↓
I am trying to get a button that will accept variables from two different mysql tables. One table contains many blogs, the other table contains site-wide things such as a few colors and buttons text (there is only 1 row in this table). My goal is to allow the user to set the button text to whatever he/she wants, in whatever language they want to use (English is not their first language, therefore they may not use the English words "Read More..."). But I am stumped with how to get this two work -
<button><a href="myBlog.php?id=<?php echo $row['id']; ?>"><?php echo $row['readMoreText'] ?></a></button>
If I set the button name permanently then no problem, but the site owner may well want to use their native language words for the button. I expect it to be something simple that I'm missing (possibly a join of some kind?), but I'm tired of banging my head against this one trying to figure it out.
I figured it out using one of those mysterious joins. Here's my sql select statement -
$sql = "SELECT site.status, site.readMoreText, blogs.id, blogs.title, blogs.postDate, blogs.para1, blogs.status FROM site INNER JOIN blogs ON blogs.status = site.status WHERE cat LIKE '%blog%' AND blogs.status = 1 ORDER BY id DESC LIMIT $offset, $no_of_records_per_page";
People are also looking for solutions of the problem: failed to create image decoder with message 'unimplemented'
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.