-
Php, help me please
I need to create a php script that writes a variable to a txt file, how would this be done? can someone give me code examples, im new at php... thanks for help in advance!
-
set the loadvars to the php code and have your php print out variablers:
PHP Code:
<?
//written by Carlos Aguilar
//connecting my ***** ass
$host= "localhost";
$username= "oz52com3";
$password= "********";
$database= "52oz_com";
mysql_connect($host, $username, $password);
mysql_select_db("$database");
$result=mysql_query("SELECT * FROM work ORDER BY date DESC LIMIT 0, 5");
$i=0;
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$disp="var$i=".$row[name]."";
if($i<4){
$disp.="&";
}
echo $disp;
$i++;
}
?>
I actually have a quick question though; should the variables be in quotes or not. Eg, should you do this
PHP Code:
var0 = "hello world"&
or
PHP Code:
var0 =hello world&
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|