- Joined
- Oct 9, 2008
- Messages
- 572
- Reaction score
- 14
Well, the thing is that I'm trying to make things easier for myself, and I figgured making a function to shortend the scripting, and here is my function:
and here is what I script:
And well, all information is correct but its simply not working. The 2 scripts are located in diffrent files, but I'm using include() and I've tested if the function "works", and it does, but when I try to print something out, it returns blank.
Help is very much appreciated
PHP:
function con_mysql($con_db,$con_sql) {
mysql_connect("localhost","root","root") or die(mysql_error());
mysql_select_db($con_db);
$result = mysql_query($con_sql);
$row = mysql_fetch_array($result);
}
PHP:
con_mysql("test","SELECT * testtable");
print $row['title'];
And well, all information is correct but its simply not working. The 2 scripts are located in diffrent files, but I'm using include() and I've tested if the function "works", and it does, but when I try to print something out, it returns blank.
Help is very much appreciated

