Jump to content

[SOLVED] Can only get ONE LINE!!!!! HELP!!! PLZ


Recommended Posts

Guess im not Being that Specific, What I Mean is, When I Enter the Code:

 

<?php

include('dbcreds.php');

echo mysql_result(mysql_query('SELECT title FROM search_data'),0,0);?>

 

 

It only Gives me the Top Row of the Title, When there should be a Load of Rows of Title

Function mysql_result that you are using accepts 3 arguments. First is resource, second is row, and third is column. In your function there is 0 for row. And thats reason, why you get only one row.

 

Try this:

$res = mysql_query('SELECT title FROM search_data');
while($row = mysql_fetch_row($res)) {
    print_r($row);
    echo '<br />';
}

yah, here the whole page code:

 

<br><br><br><br><br>

<center>

<img src="testlogo.jpg"><p>Index of Music<br>

<form action="results.php" method="post">

Search <input type="text" name="search_text"  />

<input type="submit" value="go" /><br>

(only accepts alpha-numeric characters with spaces)

</form><b>

<?php

include('dbcreds.php');

echo mysql_result(mysql_query('SELECT count(id)as data FROM search_data'),0,0);

?></b> Songs currently indexed.<br>

<p><font color=red>New Bulk File Update!</font><p>

<?php

include('dbcreds.php');$res = mysql_query('SELECT title FROM search_data');

while($row = mysql_fetch_row($res)) {

    print_r($row);

    echo '<br />';

}

?>

 

thats including the script you gave me, then heres a few rows of table:

 

id  keyword  title  link  description  rank  created  approved  sponsored 

      2539 Dizzee Dizzee Rascal - Temptation http://www.lo2n.com/DizzeeRascal/DizzeeRascalTempt... Artist: Dizzee Rascal - Song: Temptation 0 2007-10-27 10:09:00 0 0

      2535 Dizzee Dizzee Rascal - Stand Up Tall http://www.lo2n.com/DizzeeRascal/DizzeeRascalStand... Artist: Dizzee Rascal - Song: Stand Up Tall 0 2007-10-27 09:50:10 0 0

      2536 Dizzee Dizzee Rascal - Dream http://www.lo2n.com/DizzeeRascal/DizzeeRascalDream... Artist: Dizzee Rascal - Song: Dream 0 2007-10-27 10:02:07 0 0

      2538 Dizzee Dizzee Rascal - Jezebel http://www.lo2n.com/DizzeeRascal/DizzeeRascalJezeb... Artist: Dizzee Rascal - Song: Jezebel 0 2007-10-27 10:07:30 0 0

      2534 Dizzee Dizzee Rascal - Brand New Day http://www.lo2n.com/DizzeeRascal/DizzeeRascalBrand... Artist: Dizzee Rascal - Song: Brand New Day 0 2007-10-27 09:49:04 0 0

 

 

 

 

removed it, this is what i got still:

 

Array ( [0] => Dizzee Rascal - Temptation )

Array ( [0] => Dizzee Rascal - Stand Up Tall )

Array ( [0] => Dizzee Rascal - Dream )

Array ( [0] => Dizzee Rascal - Jezebel )

Array ( [0] => Dizzee Rascal - Brand New Day )

Array ( [0] => Dizzee Rascal - Jus' A Rascal )

Array ( [0] => Dizzee Rascal - GO )

Array ( [0] => Dizzee Rascal - Fix Up Look Sharp )

 

so I Put it back, as it hasnt done anything removing it

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.