The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
This is a tough one, but i was wondering if you ever ran into a problem using words rather than numbers as IDs in php/mysql before?
Before when I was simply caling files I had no trouble using words (ie smallville.php?action=bios&character=clarkkent), but now that I am calling info from the database it would only work if I called a number (ie smallville.php?action=bios&character=1) I'm not sure what I can do about this. it isnt a huge deal, I just would like to try to keep my links the same as they were for the sake of bookmarks If it isnt clear what Im talking about I can explain more. Here is the code in using to call the info PHP Code:
|
#2
|
|||
|
|||
![]()
I've used names to call many things from a database and never ran into a problem.
Maybe you had an error in your code? Post the code that didn't work for you... |
#3
|
||||
|
||||
![]()
thats the code above. I got no error, it would just always send me to the first row of the the table.
|
#4
|
|||
|
|||
![]()
if didn't create a while {}... so it's taking only the first in the query...
|
#5
|
||||
|
||||
![]()
Can you put that in novice terms? I barley know what im doing :-\
|
#6
|
||||
|
||||
![]()
<a href="http://www.thekryptonian.com/smallville.php?action=bios&bio=jonathankent" target="_blank">http://www.thekryptonian.com/smallvi...o=jonathankent</a>
Thats the page. You can see that if you click links in the Smallville Cast box on the right that you always get Clark Kents info from the database no matter what the url calls for.I dont understand why it calls the correct info when the id is a number but not a word. Should I make my ID row something other than varchar? |
#7
|
||||
|
||||
![]()
well you can't use intval() if you want it to be a string (like "jonathonkent")
try deleting the first row and changing the second to $row = $DB_site->query_first("SELECT * FROM smallville_cast WHERE id=$_GET[bio]"); |
#8
|
||||
|
||||
![]()
I get an SQL error. For some reason its not catching that the word names are the id's of the table.
Quote:
|
#9
|
||||
|
||||
![]()
you need to surround the id with 's
thats: ' making it: $row = $DB_site->query_first("SELECT * FROM smallville_cast WHERE id'=$_GET[bio]'"); |
#10
|
||||
|
||||
![]()
Thanks so much for your help. I appreciate it!
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|