PDA

View Full Version : calling mysql fields into a .php webpage


Murty
02-02-2007, 10:24 PM
Hey guys,
I currently am customizing my forum a fair bit.
And i have got stuck on this problem.

Situation:
I have created a .php document that displays a youtube video and it works fine.

What I want:
I want this .php document to display a users youtube video, so i need to get the field from the database and make it so the .php document can call it and use the link from it to display the video.

The server is called: 'localhost'
The database is called 'db_vbulletin'
The table is called 'userfield'
The field is called 'field39'

But saying this, the youtube video link will be different between users, so im not sure what kind of factor that would have.

If i am posting in the wrong place or there is a better forum, please direct me.
Thanks.

Murty

Bump

Murty
02-04-2007, 12:11 PM
Bump

Antivirus
02-04-2007, 10:45 PM
Hi murty, If the youtube url is stored in a custom profile field within vbulletin, you should just be able to call the url with $vbulletin->userinfo['field39'] in your template as the url like:

<a href="$vbulletin->userinfo['field39']>youtube link</a>

Murty
02-05-2007, 12:25 AM
Thanks for the reply antivirus.
But i just tried your idea, and it comes up with this first:

userinfo['field39']>youtube link

When i click on that, it comes up with this:

Not Found
The requested URL /forum/$vbulletin- was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Any ideas?

Kirk Y
02-05-2007, 02:07 AM
If you're using this in a template:
$bbuserinfo[field39]

If you're using this in Plugins:
$vbulletin->userinfo['field39']

Murty
02-05-2007, 02:42 AM
Yeah, but im not using a plugin. I'm using a .php file in the forum root.

Kirk Y
02-05-2007, 05:12 PM
If you've included global.php then the Plugin code I posted above should work.

Murty
02-05-2007, 08:27 PM
What do you mean, 'included global.php'?

Kirk Y
02-06-2007, 12:11 AM
require_once('./global.php');

Murty
02-06-2007, 04:34 AM
hmm, not sure how this is meant to work, but it hasnt so...

Bump