What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP help please

PHP help please
Author: Message:
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
O.P. Huh?  PHP help please
I'm kinda new to making my own functions and i'm having some trouble...

I made this function in a php script I included

code:
function query_db($table){
$data = mysql_fetch_array(mysql_query("SELECT * FROM `".$table."` WHERE id=".$_GET['id']));
return $data;
}


and then I wanted to execute it, and typed

code:
query_db("imdb_data_title");


after the including, but that didn't work, later a friend helped a little and we managed to make it work like this:

code:
$data = query_db("imdb_data_title");


If somone knows a better way of doing that please tell me :)

Then another thing that doesn't work yet...

I have another function in the same script

code:
function link_rewrite(){
//Voor op de profielen worden de films veranderd door links
//actor
$actor = str_replace("Paris Death Monkeys (2004)","<a href=\"title.php?id=2\">Paris Death Monkeys (2004)</a>", $actor);
$actor = str_replace("Ameland: The Movie (2003)","<a href=\"title.php?id=1\">Ameland: The Movie (2003)</a>", $actor);
$actor = str_replace("\"Bredero\" (2004)","<a href=\"title.php?id=0\">\"Bredero\" (2004) </a>", $actor);

//writer
$writer = str_replace("Paris Death Monkeys (2004)", "<a href=\"title.php?id=2\">Paris Death Monkeys (2004)</a>", $writer);
$writer = str_replace("Ameland: The Movie (2003)", "<a href=\"title.php?id=1\">Ameland: The Movie (2003)</a>", $writer);
$writer = str_replace("\"Bredero\" (2004)", "<a href=\"title.php?id=2\">\"Bredero\" (2004)</a>", $writer);
}


It's a little longer but they are all str_replaces with other names
then when I wanted to execute the function I typed this

code:
link_rewrite();


But it doesn't work :(

Can someone please help me with this??

TIA...

[Image: 1-0.png]
             
07-03-2005 04:25 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP help please - by Ezra on 07-03-2005 at 04:25 PM
RE: PHP help please - by Eljay on 07-03-2005 at 04:31 PM
RE: PHP help please - by Ezra on 07-03-2005 at 04:39 PM
RE: PHP help please - by Dempsey on 07-03-2005 at 06:02 PM
RE: PHP help please - by Fourjays on 07-03-2005 at 10:36 PM
RE: PHP help please - by jren207 on 07-04-2005 at 12:09 AM
RE: PHP help please - by Ezra on 07-04-2005 at 01:44 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On