Jump to content

CanMan2004

Members
  • Posts

    254
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

CanMan2004's Achievements

Advanced Member

Advanced Member (4/5)

1

Reputation

  1. Thanks, ive found a way to do it
  2. Hi all I have a table which looks like id dmid pgid 43 14 56 10 9 6 26 7 21 42 22 6 I want to write a query which returns all rows, but groups them. For example, with the above data, it would return 3 rows, because there is 2 rows which have the same pgid, so that is classed as 1 row. So the query should return pgid: 6 pgid: 21 pgid: 56 but then I want to print under each row, the dmid value for each row in the database, for example pgid: 6 dmid: 9 dmid: 22 pgid: 21 dmid: 7 pgid: 56 dmid: 14 Does that make sense? Can anyone help? Thanks in advance Ed
  3. Hi all Im trying to do a simple query to pick up all rows which have no value in one of there fields. The problem is that all rows which have NULL as a defult value, are not treated as empty. How can I make the query read NULL as an empty field? Thanks Ed
  4. Hi Thanks, but that doesnt seem to remove any spaces from the filename
  5. So where should I encorporate trim() into my query?
  6. Hi all I've written a script to upload a resize an image, but I cant figure out how I can get it to remove all spaces from the filename, the code is if ($_FILES['image']['name'] != '') { $randy = random(12); $uploadImageDir = '../image_upload/activity_uploads/'.$randy.''; $uploadImage = $uploadImageDir . $_FILES['image']['name']; $uploadImageFormat = $randy.$_FILES['image']['name']; if (move_uploaded_file($_FILES['image']['tmp_name'], $uploadImage) ) { } $imageupload = $uploadImage; createthumb($imageupload,$imageupload,767,'','',411); } else { print"<script>alert ('There was a problem with your image');</script>"; print"<script>document.location='register.php'; </script>"; } Where would I place a str_replace function? Can anyone help? Thanks Dave
  7. not 100% sure, doing this for a friend, what could they be?
  8. Hi all I've got some code which does a query on a database and then returns a list of document ares and under each area, is the relevant documents. For some reason, it wont return the document area names if they contain an uppercase character or a symbol such as / or ' for some reason, it will return the areas containing a & symbol. The code I believe is doing this is $qry = $this->DB->prepare("SELECT * FROM page_documents WHERE pd_pgid=:id"); $qry->bindParam(":id", $id); $qry->execute(); while ($row = $qry->fetch()) { $a[] = $row['pd_dmid']; } But I cannot see what could be doing it. Can anyone help Thanks in advance Ed
  9. Hi all I have been trying to do a query but I get Call to undefined function mysql_connect() What other way can I perform a query? Or do I need to get something enabled? Thank in advance Dave
  10. Thats great everyone, got it working now, thank you
  11. Hi Basically here is a snippet of my db ID TYPE DATE FROM 1 1 01-02-2007 2 1 01-02-2007 3 2 01-02-2007 So with my query all the above are returned, which is a mix of 1's and 2's, so if that happens, it should print "mixed" just once. On the otherhand, if the database looked like ID TYPE DATE FROM 1 1 01-02-2007 2 1 01-02-2007 Then it would print "one" as all the rows returned have 1 under there type. Does that clear any questions up? Thanks so far
  12. That doesnt seem to work correctly, if there is a mix of 1's and 2's then it doesnt print "mixed" it just print "one<br>two"
  13. Hi all I have a database which holds events, the database looks like ID TYPE DATE FROM 1 1 01-02-2007 2 1 01-02-2007 3 2 01-02-2007 What I want to do is run the query below $sql = "SELECT * FROM `events` WHERE `datefrom` = '01-02-2007"; $query = @mysql_query($sql,$connection) or die(mysql_error()); while ($row = mysql_fetch_array($query)) { print $row['type']; print "<br>"; } The query above currently returns the result 1 1 2 What I want to do is to change the above query and say if all the rows returned all have 1 as there $row['type'] value then print "one"; if all the rows returned all have 2 as there $row['type'] value then print "two"; and if all the rows returned all have a mix of 1 and 2 as there $row['type'] value then print "mixed of one and two"; Does this make much sense? Any help would be great Thank in advance Dave
  14. Thanks, I get the error Call to undefined function mysql_connect() Do I need to enable something?
  15. What should I check in the php.ini file? Or would that not be causing the issue
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.