Author Topic: Hello i nead help  (Read 945 times)

0 Members and 1 Guest are viewing this topic.

Offline chileno27

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Hello i nead help
« on: February 04, 2010, 10:43:19 PM »
Hello i nead help i have installed this system in subdomain and i want to put last 5 videos in a table 1 row 5 colum in my homepage but i don't know what code php i have to put and i will nead a config.php and i don't know how to do that
« Last Edit: February 04, 2010, 10:45:57 PM by chileno27 »

Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Hello i nead help
« Reply #1 on: February 04, 2010, 10:58:10 PM »
Your config.php file is created automatically when you install.

Offline chileno27

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Hello i nead help
« Reply #2 on: February 04, 2010, 11:02:45 PM »
is not my question for example this system i have installed in phpdirector.mysite.com and i want to put 5 last videos in www.mysite.com in 1 row and 1 colum you understand me?
sorry about my english

Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Hello i nead help
« Reply #3 on: February 04, 2010, 11:24:18 PM »
Hello i nead help i have installed this system in subdomain and i want to put last 5 videos in a table 1 row 5 colum in my homepage but i don't know what code php i have to put and i will nead a config.php and i don't know how to do that

It's a part of your question

Fot what you want, I think you need to use javascript to do it
« Last Edit: February 04, 2010, 11:27:14 PM by hilflo »

Offline chileno27

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Hello i nead help
« Reply #4 on: February 04, 2010, 11:38:29 PM »
with php code and one config.php to connect the db it will work. anyone knows how to do that?

Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Hello i nead help
« Reply #5 on: February 04, 2010, 11:47:15 PM »
config.php
Code: [Select]
<?php

$cfg
["db_host"] = "localhost";
$cfg["db_name"] = "bzhmedia";
$cfg["db_user"] = "root";
$cfg["db_pass"] = "";  

$mysql_link mysql_connect($cfg["db_host"], $cfg["db_user"], $cfg["db_pass"]) or die(mysql_error());

mysql_select_db($cfg["db_name"], $mysql_link) or die(mysql_error());
?>


php code
Code: [Select]
<table width="1OO%">
   <tr>
<?php
$query 
"SELECT * FROM pp_files WHERE approved = 1 ORDER BY id DESC LIMIT 5";
$last mysql_query($query) or die (mysql_error());
while (
$row mysql_fetch_array($last))
{
echo 
'<td width="20%"><a href="yoururl/videos.php?id='.$row['id'].'">
<img height='
89' width='120' src="'.$row['picture'].'" alt="'.$row['name'].'"title="'.$row['name'].'"  />
</a></td>'
;  

}
?>

</tr>
</table>
« Last Edit: February 05, 2010, 12:00:43 AM by hilflo »

Offline chileno27

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Hello i nead help
« Reply #6 on: February 04, 2010, 11:53:26 PM »
thank for your help  i found this error
Parse error: parse error, expecting `','' or `';'' in     on line 10


Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Hello i nead help
« Reply #7 on: February 05, 2010, 12:01:47 AM »
I have edited the php code of the last post, change it and retry

Offline chileno27

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Hello i nead help
« Reply #8 on: February 05, 2010, 12:03:59 AM »
i change but i have the same error  :-\

Offline chileno27

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Hello i nead help
« Reply #9 on: February 05, 2010, 12:14:30 AM »
   <img height="89" width="120" src="'.$row['picture'].'" alt="'.$row['name'].'"title="'.$row['name'].'"  />

this is the solution. thank you so much for your help

Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Hello i nead help
« Reply #10 on: February 05, 2010, 12:16:50 AM »
N problem, If I can help