Oops, solved it already myself!
Thanks anyway,
Ed
Search found 13 matches
- Sat Jan 24, 2004 4:20 am
- Forum: PHP - Code
- Topic: Cookie problems - won't set with an expiry argument
- Replies: 2
- Views: 238
- Sat Jan 24, 2004 3:58 am
- Forum: PHP - Code
- Topic: Cookie problems - won't set with an expiry argument
- Replies: 2
- Views: 238
Cookie problems - won't set with an expiry argument
I have a problem with cookies, such that the cookie won't set if the expiry argument is included, either in the date() form or mktime(). If I simply put setcookie("name", "value"); then it's set fine, but that's no good for me :( Can anyone suggest why this is so? Thanks, Ed Ludlow
- Fri Jan 23, 2004 4:25 pm
- Forum: PHP - Code
- Topic: Cookies
- Replies: 8
- Views: 1347
- Fri Jan 23, 2004 4:09 pm
- Forum: PHP - Code
- Topic: Cookies
- Replies: 8
- Views: 1347
- Fri Jan 23, 2004 4:03 pm
- Forum: PHP - Code
- Topic: Cookies
- Replies: 8
- Views: 1347
- Fri Jan 23, 2004 3:31 pm
- Forum: PHP - Code
- Topic: Cookies
- Replies: 8
- Views: 1347
Cookies
Am experimenting with cookies for the first time, and they're not working lol! File 1: <?php setcookie("test", "testValue", time()+120); echo ("Cookie set"); ?> And file 2: <?php echo $_COOKIE['test']; ?> I think it's setting the cookie ok, but I don't see why it's not ...
- Fri Jan 23, 2004 1:58 pm
- Forum: PHP - Code
- Topic: Loops and mySQL
- Replies: 2
- Views: 479
- Fri Jan 23, 2004 10:10 am
- Forum: PHP - Code
- Topic: [SOLVED] SQL - what's up with this?
- Replies: 4
- Views: 453
- Fri Jan 23, 2004 9:46 am
- Forum: PHP - Code
- Topic: [SOLVED] SQL - what's up with this?
- Replies: 4
- Views: 453
- Fri Jan 23, 2004 8:17 am
- Forum: PHP - Code
- Topic: [SOLVED] SQL - what's up with this?
- Replies: 4
- Views: 453
[SOLVED] SQL - what's up with this?
<?php $connection = mysql_connect ('localhost', 'ed', 'password') or die(mysql_error()); mysql_db_query ("x-appeal", $connection); $q = "SELECT date,newsitem,id FROM xanews ORDER BY id DESC, LIMIT 0,5"; $q_temp = "SELECT id FROM xanews"; if(mysql_num_rows($q) != 0) { $i...
- Fri Jan 23, 2004 6:02 am
- Forum: PHP - Code
- Topic: Loops and mySQL
- Replies: 2
- Views: 479
Loops and mySQL
I hate writing loops, and I've been trying to work this one out for a while now. I know it's smurf simple to write, and I should be able to do it, but brain often shuts down while writing loops, so I'm calling on you good people for help!
Bascially, I've an SQL table, each row having a unique "id" field, a simple integer. The first row in the table is 1, and when each new row is added, that number gets incremented. That's all fine and working.
What I want to produce is a simple php script that will write the latest five rows in the table to the screen, and then produce the rest of the rows on another page - a sort of archive.
How would you go about producing:
1) the loop to print JUST the first five
and
2) the loop to write all the rows after the first five.
Many thanks,
Ed Ludlow
Bascially, I've an SQL table, each row having a unique "id" field, a simple integer. The first row in the table is 1, and when each new row is added, that number gets incremented. That's all fine and working.
What I want to produce is a simple php script that will write the latest five rows in the table to the screen, and then produce the rest of the rows on another page - a sort of archive.
How would you go about producing:
1) the loop to print JUST the first five
and
2) the loop to write all the rows after the first five.
Many thanks,
Ed Ludlow
- Thu Jan 22, 2004 4:01 pm
- Forum: PHP - Code
- Topic: Adding to SQL DB
- Replies: 2
- Views: 277
- Thu Jan 22, 2004 3:48 pm
- Forum: PHP - Code
- Topic: Adding to SQL DB
- Replies: 2
- Views: 277
Adding to SQL DB
I've got a VERY simply script with which I wish to add some data to a DB. As far as I can see, it should work - any ideas why it's not?! <?php $connection = mysql_connect ("myhost", "ed", "mypassword"); $date = date("F j, Y"); $confirmednewtoadd = $_POST['conf...