/    Sign up×
Community /Pin to ProfileBookmark

I am wonderin if this is the correct syntax to select the most current data within the database… here:

[code]
mysql_query(“select * from database order by date desc limit 0, 15”);
[/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@Kyleva2204Dec 08.2003 — err close ? try this:
[code=php]
$sql = "select * from database order by date desc limit 0, 15";
mysql_query($sql, $connect) or die(mysql_error());
[/code]

Now I'm not sure but I always define $connect with the mysql_connect function like this:
[code=php]
$connect = mysql_connect(me, pass, localhost);
[/code]

but u almost had it.

[i]Originally posted by Jonathan [/i]

[B]I am wonderin if this is the correct syntax to select the most current data within the database... here:



<i>
</i>mysql_query("select * from database order by date desc limit 0, 15");
[/B][/QUOTE]
Copy linkTweet thisAlerts:
@JonathanauthorDec 08.2003 — Isn't the exact same thing? ?

I didn't include the mysql connection. I was just wonderin if that was how you grab something (the last 15 in decending order)

I use the persistant connection

mysql_pconnect("localhost","username","password")

I was raised to use that ?
Copy linkTweet thisAlerts:
@Kyleva2204Dec 08.2003 — O hmmm pconnect cool. I'm a starter at PHP and I always used connect. wow thanks turns out u tought me sumtin :rolleyes:. Anyway this is just a snipplet of it:
[code=php]
SELECT *
FROM comments
WHERE 1
ORDER BY Name DESC LIMIT 0 , 30
[/code]

^ correct


[i]Originally posted by Jonathan [/i]

[B]Isn't the exact same thing? ?



I didn't include the mysql connection. I was just wonderin if that was how you grab something (the last 15 in decending order)



I use the persistant connection



mysql_pconnect("localhost","username","password")



I was raised to use that ? [/B]
[/QUOTE]
×

Success!

Help @Jonathan 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...