/    Sign up×
Community /Pin to ProfileBookmark

This is my sql table

[code=php]
CREATE TABLE `members` (
`username` TEXT NOT NULL ,
`password` TEXT NOT NULL ,
`email` TEXT NOT NULL ,
`posts` TEXT NOT NULL ,
`avatarurl` TEXT NOT NULL ,
`dateregistered` TEXT NOT NULL ,
`age` TEXT NOT NULL ,
`rank` TEXT NOT NULL ,
`sig` TEXT NOT NULL ,
`ipaddress` TEXT NOT NULL
);[/code]

i know how i can make this into a register form i was wondering thou how can you select a certain field say ip address belonging to the user ‘jake’ and then display it in a php page?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@pyroDec 13.2003 — [code=php]# connect to the database
$sql = "SELECT ipaddress FROM members WHERE username = 'jake;";
$results = mysql_query($sql);
$data = mysql_fetch_array($results);
# $data['ipaddress'] OR $data[0] will equal the IP address - I prefer the former, as it is easier to read later on[/code]
×

Success!

Help @lukezweb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.14,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...