More Virtual Promote ... Gazette · Webmaster & SEO Tools · Scumware.com · Free Website Templates

SEF

Search Engine Forums
Helping to make the Web - Since 1998
Virtual Promote Member Spotlight
Buy and Sell Text Links

No fees to the buyer or seller. Sites is genuinely 100% free. Increase tha (bsl)

Login Password Forget your password?    Trouble Logging In?
.
Forums Index Active Topics New Topics My Topics Search My Profile Register Inbox   Rules & TOS
.
 
Forum Index · Search Engine Forums · SEF Community & Networking · Members Lounge · Hosting Company Induced Insanity!
 
Remove from hotlist
Reply to this thread Create a New Topic in this forum
Mark This Forum Read
Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend  
Moderator(s): excell, SportsGuy, g1smd
Previous Topic Next Topic
Member Message

leelee700
Joined: Oct 09, 2006
# Posts: 50

View the profile for leelee700 Send leelee700 a private message

Posted: 12/26/2006 07:29 am
Edit Message Delete Message Reply to this message

hi everyone-

ive just realized that i have gone absolutely bonkers trying to work around my hosting company's upgrade and im looking for professional help!

here's what happened:

im developing a site that runs on php and queries a mysql database - user searches for information and they get results - if results are more than 10, the results are spaced over x number of pages. so my php code drives the search as well as the pagination of results. all was working well....

until my host upgraded my account to their hosting version 2.0 (upgraded from 1.0). well, now the pagination scheme stopped working on this new upgraded version, but the search and everything else continues to work.

ive tried all sorts of pagination schemes - my own code, free code found on the itnernet - nothing works - for whatever reason, i can not get the resutls to paginate correctly! some code works well enough for the 'next" page links to show up, but they dont go anywhere or point to the same page.

i contacted the host and they said that there upgrades can sometimes result in this type of thing, and that some sites wont work properly when they upgrade. unfortunately, they will not allow me to downgrade back to the account version where my site worked properly.

so, since ive gone bonkers trying to figure out whats wrong and find work around solitions, id like to find a professional php developer who can help me out with some pagination code that actually works! please let me know if you are such a person.

anyone else have this same issue or experiencing same issue?









Dinkar
Moderator
Joined: Aug 12, 2001
# Posts: 4268

View the profile for Dinkar Send Dinkar a private message

Posted: 12/26/2006 08:09 am
Edit Message Delete Message Reply to this message

My guess:

Your current method of getting variable values isn't working. You need to get the values using some different method.



leelee700
Joined: Oct 09, 2006
# Posts: 50

View the profile for leelee700 Send leelee700 a private message

Posted: 12/26/2006 08:19 am
Edit Message Delete Message Reply to this message

Thanks Dinkar. The upgrade they did now means that it runs PHP 5. Is there some special way to paginate using PHP5? Do you have some code you can share?

THanks!




excell
Moderator
Joined: Mar 19, 2001
# Posts: 14495

View the profile for excell Send excell a private message

Posted: 12/26/2006 03:51 pm
Edit Message Delete Message Reply to this message

If you search for it, you might find what you seek:
Try this for a start...



Dinkar
Moderator
Joined: Aug 12, 2001
# Posts: 4268

View the profile for Dinkar Send Dinkar a private message

Posted: 12/27/2006 03:41 am
Edit Message Delete Message Reply to this message

Read this. If it isn't helpful, post your code. We will try to help you.





leelee700
Joined: Oct 09, 2006
# Posts: 50

View the profile for leelee700 Send leelee700 a private message

Posted: 12/28/2006 04:54 am
Edit Message Delete Message Reply to this message

thanks excell! believe it or not, i searched high and low before posting here. i generally prefer to find stuff myself than ask for help, and only turn to a forum when im at a loss. tried all sorts of code to no avail!

thanks Dinkar! i beleve the problem is related to register globals being turned off when host upgraded me. now i turned it on and the script works. wondering if turning globals on is a good idea (that's why i started other thread on that topic). ive read about it on some sights but cant figure out if its bad in my case. maybe i can post my code and get feedback on that issue?



Dinkar
Moderator
Joined: Aug 12, 2001
# Posts: 4268

View the profile for Dinkar Send Dinkar a private message

Posted: 12/28/2006 10:40 pm
Edit Message Delete Message Reply to this message

This page will explain how one can write insecure code with this directive but keep in mind that the directive itself isn't insecure but rather it's the misuse of it.

Source: Using Register Globals

IMO, don't turn it 'ON'; but modify your code to make it secure and compatible with the latest php version.




leelee700
Joined: Oct 09, 2006
# Posts: 50

View the profile for leelee700 Send leelee700 a private message

Posted: 01/07/2007 05:05 pm
Edit Message Delete Message Reply to this message

Thanks Dinkar - I finally figured that out. I had register globals off. Anyway, wonder if you can help with another question?

I'm trying to be able to search a database when a user enters multiple words into a search box. My code works fine for a search with one word, but not more than one.

The following code works fine for one search term:
//Get search term from search box

$var = @$_GET['q'] ;

//Trim extra white space
$trimmed = trim($var);


//Code to connect to database
//Some other code to check of a search term was entered, etc.


//Query database



$query = "select * from $table where $field1 LIKE
"%$trimmed%"

order by $field1";

//Etc...

BUT, the following code will NOT work (which being a newbie I'd expect to work for multiple search terms):


//Get search term from search box

$var = @$_GET['q'] ;

//Trim extra white space
$trimmed = trim($var);


//Code to connect to database
//Some other code to check of a search term was entered, etc.


//Query database



$query = "select * from $table
where $field1 LIKE "%$trimmed%
or
where $field2 LIKE "%$trimmed%
or
where $field4 LIKE "%$trimmed%
or
where $field5 LIKE "%$trimmed%
or
where $field6 LIKE "%$trimmed%
or
where $field8 LIKE "%$trimmed%
or
where $field16 LIKE "%$trimmed%
or
where $field17 LIKE "%$trimmed%"

order by $field1";

//Etc...

Basically, I'm combinding LIKE with OR. Any ideas or help would be appreciated.

BTW, here is the error message I get with the above code:

DB Error Occurred: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' or where field1 LIKE "%105% or where field2 LIKE "%105% o

Any help would be appreciated!



leelee700
Joined: Oct 09, 2006
# Posts: 50

View the profile for leelee700 Send leelee700 a private message

Posted: 01/07/2007 05:05 pm
Edit Message Delete Message Reply to this message

Oh I forgot to mention that the "105" in the error code is the search term.



Dinkar
Moderator
Joined: Aug 12, 2001
# Posts: 4268

View the profile for Dinkar Send Dinkar a private message

Posted: 01/08/2007 01:13 am
Edit Message Delete Message Reply to this message

Use 'where' only once and try.

Example:

select * from $table
where $field1 LIKE "%$trimmed%
or
$field2 LIKE "%$trimmed%
or
$field3 LIKE "%$trimmed%
order by $field1";

Let us know if it is working.



leelee700
Joined: Oct 09, 2006
# Posts: 50

View the profile for leelee700 Send leelee700 a private message

Posted: 01/08/2007 04:37 am
Edit Message Delete Message Reply to this message

Hi Dinkar - thanks but unfortunately that didn't work. Can you suggest a different code for searching when the user enters multiple search terms?

Thanks for your help.



Dinkar
Moderator
Joined: Aug 12, 2001
# Posts: 4268

View the profile for Dinkar Send Dinkar a private message

Posted: 01/08/2007 08:20 am
Edit Message Delete Message Reply to this message



Code: [copy]




It's working, just test :)




 
Forum Index · Search Engine Forums · SEF Community & Networking · Members Lounge · Hosting Company Induced Insanity!
Who's Online?
Reflects user activity within the last 5 minutes
Previous Topic Next Topic
You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
  1. You have not yet logged in, or registered properly as a member
  2. You are a member, but no longer have posting rights.
  3. This is a private forum, for which you do not have permissions.

If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

If you cannot find this message, click here to Re-Send it.

If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread



Related Forum Topics
  1. Dating Community + Domain & Hosting for sale! (In: I Want to Sell My Website)
  2. Ad network company for sell (In: I Want to Sell My Website)
  3. Please help me in choosing web hosting (In: Domains, Hosting, DNS & Server Issues)



© 1995 - 2006  ·  iWeb, Inc  ·  DBA JimWorld Productions