Page 1 of 1

Making php query public

Posted: Tue Jun 22, 2010 2:23 pm
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!

Re: Making php query public

Posted: Tue Jun 22, 2010 2:49 pm
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