Jump to content

qns abt mysql functions


aaronlzw_21

Recommended Posts

i have a qns.. is there a mysql function that takes out the whole table and store it in a variable. and from there we access it? like in asp.net there is.

and another qns is that lets say a for loop that loop 3 times. how do i halt it till a user clicks on something update the database then loop the second time and same thing happen, halt, click then loop again. is there a fuction?

thanks ya..
Link to comment
https://forums.phpfreaks.com/topic/9761-qns-abt-mysql-functions/
Share on other sites

You can fetch all of a tables data and loop through it with something like: [code]<?php
$result = mysql_query("SELECT * FROM `table`");
while($row = mysql_fetch_assoc($result)) {
    //Echo your columns here with $row['name'] to print the column 'name'
}
?>[/code]

You won't be able to do your second question as easily with PHP - Everything is processed on the server before it is passed to the users browser. You'll have to pass a count to and from your page to keep track of cycles and clicks.
Link to comment
https://forums.phpfreaks.com/topic/9761-qns-abt-mysql-functions/#findComment-36179
Share on other sites

[!--quoteo(post=374223:date=May 16 2006, 04:41 PM:name=SemiApocalyptic)--][div class=\'quotetop\']QUOTE(SemiApocalyptic @ May 16 2006, 04:41 PM) [snapback]374223[/snapback][/div][div class=\'quotemain\'][!--quotec--]
You can fetch all of a tables data and loop through it with something like: [code]<?php
$result = mysql_query("SELECT * FROM `table`");
while($row = mysql_fetch_assoc($result)) {
    //Echo your columns here with $row['name'] to print the column 'name'
}
?>[/code]

You won't be able to do your second question as easily with PHP - Everything is processed on the server before it is passed to the users browser. You'll have to pass a count to and from your page to keep track of cycles and clicks.
[/quote]


okok thanks.. what's the differences between mysql_fetch_assoc(), mysql_fetch_row() and mysql_fetch_array()? they all seem to work the same way..
Link to comment
https://forums.phpfreaks.com/topic/9761-qns-abt-mysql-functions/#findComment-36181
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.