Making php query public

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Superphil
Forum Newbie
Posts: 3
Joined: Tue Jun 08, 2010 11:59 am

Making php query public

Post by Superphil »

Hello, I'm new to php and I was wondering if you guys could help me out here. This is more of a logical question rather then a syntactical one.

I'm building a site that people can post bible verses and have them comment on the verse. That is functioning correctly as of right now. But what I want is for them to be able to share it with other people via a link.

http://biblev.com/users/viewVerse.php?versid=17

Example here is a link to a verse that I have responded to. You can't see the verse or anything because you're not logged in.

Code: Select all

if(($result) && mysql_num_rows($result) >= 1) {
That is the code that checks to see if the verse should be displayed. Seeing as the query (i think ) is what is failing, how can I have it so that everyone can view it? I am VERY sure that there is a verse in the database and that rows is 1.

Thanks!
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: Making php query public

Post by Jade »

Is this for a search form? Typically when you program a search properly all they would need to do is share the URL generated by their search. For example http://domain.com/search.php?topic=gras ... affordable. Your search form would then check for existing search criteria every time the page loads and re-query on those criteria.

However if you have something where they're each building a complex custom query you could use a database and stores every unique query someone has run on the website. In the table you'd have the query string, a field for public Y/N field and an auto incrementing ID number. Then anytime someone wants to share their query you would just give them a URL which will automatically pull up and run that query: http://domain.com/search.php?queryid=4539218232
Post Reply