Search found 58 matches

by richo
Mon May 26, 2008 5:15 am
Forum: PHP - Theory and Design
Topic: Add link into textfield CMS
Replies: 1
Views: 581

Add link into textfield CMS

Hi,

I'm building a CMS. I want the user to be able to insert a link into a textfield, to allow them to easily add links into their posts without knowing any HTML.

What would be the methodology of this?

Richo
by richo
Sun May 25, 2008 10:32 am
Forum: PHP - Code
Topic: Setting permissions on a temp folder in IIS
Replies: 0
Views: 175

Setting permissions on a temp folder in IIS

Hi,

I set a new folder to be by temp upload folder.

But how do i set the right permissions on the folder.

I'm using IIS.

I think it's permissions as it's not writing any temp files to it and I get the 'failed to open stream....' errors.

Please help, i'm really stuck!!

Richo
by richo
Thu Oct 11, 2007 5:31 am
Forum: PHP - Theory and Design
Topic: What's the best programme to write PHP in?
Replies: 1
Views: 922

What's the best programme to write PHP in?

I'm used to using Dreamweaver, but my version (MX 2004) barely has any code hints.

ASP.NET has Visual Studio, I just wondered what's the best programme to use for PHP?

Free programmes preferred!
by richo
Sun Sep 10, 2006 11:07 am
Forum: PHP - Code
Topic: Random Number from Array of Primary Keys
Replies: 12
Views: 1588

cool, cheers for the pointers. i've learnt allot from doing this random thing.
by richo
Sun Sep 10, 2006 10:49 am
Forum: PHP - Code
Topic: Random Number from Array of Primary Keys
Replies: 12
Views: 1588

:oops: oops!

Cheers Jay, that's super helpful, looks like a really useful method!

:D cheers :D
by richo
Sun Sep 10, 2006 10:25 am
Forum: PHP - Code
Topic: Random Number from Array of Primary Keys
Replies: 12
Views: 1588

Thanks, so you use the ORDER to build in the random and as it's only displaying 1, it brings back one random number bit of data from the list. i'm now trying to place the random pkey into another select statement to bring back all the data for that row: $result = mysql_query("SELECT pkey,title,...
by richo
Sun Sep 10, 2006 10:15 am
Forum: PHP - Code
Topic: Random Number from Array of Primary Keys
Replies: 12
Views: 1588

sorry i got it now:

Code: Select all

$rand = mysql_result(mysql_query("SELECT pkey FROM slides ORDER BY RAND() LIMIT 1"), 0, 0);
Many thanks! Much appreciated!

I have no idea how the code above works though, would you be able to explain it to me?
by richo
Sun Sep 10, 2006 10:12 am
Forum: PHP - Code
Topic: Random Number from Array of Primary Keys
Replies: 12
Views: 1588

tried out the code, got this error: Parse error: parse error, unexpected ',' in c:\Inetpub\wwwroot\index.php on line 12 (the line of the code) $ran2 = (mysql_query("SELECT pkey FROM slides ORDER BY RAND() LIMIT 1"), 0, 0); okay, tried yours exactly and it works! But how could i put this re...
by richo
Sun Sep 10, 2006 9:57 am
Forum: PHP - Code
Topic: Random Number from Array of Primary Keys
Replies: 12
Views: 1588

i don't understand how i could implement this in my WHERE statement.

WHERE primary key = random primary key.
by richo
Sun Sep 10, 2006 9:40 am
Forum: PHP - Code
Topic: Random Number from Array of Primary Keys
Replies: 12
Views: 1588

Random Number from Array of Primary Keys

Hi, i want to select a random number from all primary keys in a mySQL table. How would i do this? At the moment i'm selecting a random number from 1 to the total number of rows. However, if i deleted a row in the table, it could still come up with a number that doesn't exist in the primary key colum...
by richo
Sun Sep 10, 2006 6:04 am
Forum: PHP - Code
Topic: PHP Query for WHERE MySQL Statement not working
Replies: 1
Views: 324

Problem Solved

I had not worked it properly.

See new code below:

Code: Select all

$result2 = mysql_query("SELECT img FROM slides WHERE pkey = '$_REQUEST[slide]'");
$img = mysql_fetch_array($result2);

Code: Select all

<?php echo "<img src=\"" . $img["img"] . "\" />"; ?>
by richo
Sun Sep 10, 2006 5:58 am
Forum: PHP - Code
Topic: PHP Query for WHERE MySQL Statement not working
Replies: 1
Views: 324

PHP Query for WHERE MySQL Statement not working

Hi, i'm working on a slideshow, I'm using a query string that should dictate which image etc is displayed. I'm using this query in a WHERE statement, comparing it to the primary key of the row to select the relevant information. BUT, the only thing it brings back is: Resource id #5 My code is below:...
by richo
Sun Sep 10, 2006 5:37 am
Forum: PHP - Code
Topic: Deleted MySQL Rows, Count Still Picks Them Up
Replies: 1
Views: 377

If it helps anyone answer my question, it was somehow fixed when i did this instead: $result = mysql_query("SELECT * FROM slides"); $rowTotal = mysql_num_rows($result); Is it possible that there was some kind of clashing before with the: $result = mysql_query("SELECT * FROM slides&quo...
by richo
Sun Sep 10, 2006 4:29 am
Forum: PHP - Code
Topic: Deleted MySQL Rows, Count Still Picks Them Up
Replies: 1
Views: 377

Deleted MySQL Rows, Count Still Picks Them Up

I count the number of rows and then loop through to the total number. But after deleting a couple of rows, it still counts that number even though they don't exist anymore. Relevant code below: count: $rowTotal = mysql_query("SELECT COUNT(*) FROM slides"); for loop: for ($i=1; $i<=$rowTota...
by richo
Sat Sep 09, 2006 11:28 am
Forum: PHP - Theory and Design
Topic: Slideshow, list of slides - 1,2,3 etc - future proof
Replies: 2
Views: 1058

Okay, i'll try and explain better: At the moment it is displaying: - 1 - 3 - 4 I have a column in table called "active". If active has the value of "0", that row will not be brought out by the for loop. The consequence of this is that the list displays as: - 1 - 3 - 4 instead of:...