Re: [PHP-DB] SQL Guru Question:

2002-11-26 Thread Joakim Andersson
Pete wrote: I'm trying to write a query to update the comission calculations on a database The sql looks something like select (round(pr_contents * 12)+ round(pr_buildings * 12)) *.33 as agent, (round(pr_contents * 12) + round(pr_buildings * 12)) * .5 as manager, from pipeline if there a way

Re: [PHP-DB] DB-stored images

2002-11-26 Thread Joakim Andersson
Ohlson Stefan wrote: Hi! I have a db where we stores images in the database but I haven't figured out how I display that image after I've selected it from the table. I've tried with and but $data just return the Select-query: Picture I'm not familiar with fetching data from Oracle, but t

RE: [PHP-DB] MySql security

2002-11-19 Thread Joakim Andersson
> Hi, > > Since i dont know any mysql group, i will try here - it is > anyway related to > php. > When i want to make php/mysql application i have mysql on the > server and i > connect to it with mysql_pconnect("localhost","root","") and it works. > I assume that any user or hacker could connect

RE: [PHP-DB] How to Check Directory exist in Specific Folder

2002-11-19 Thread Joakim Andersson
> Dear all > > Does php have any script which can check if a directory exist > in specific > folder? > > Thx a lot > > Jack if (is_dir ("/path/to/your/folder") ) echo "Dir exists"; else echo "Dir doesn't exist"; Regards Joakim -

SV: [PHP-DB] Find out a pic size?

2002-11-11 Thread joakim . andersson
> -Ursprungligt meddelande- > Från: Snijders, Mark [mailto:Mark.Snijders@;atosorigin.com] > Skickat: måndag den 11 november 2002 09:03 > Till: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] > Ämne: RE: [PHP-DB] Find out a pic size? > > > check this out: > > http://www.php.net/manual/en/ref.image

SV: [PHP-DB] Find out a pic size?

2002-11-10 Thread joakim . andersson
> Hi, > > I'm working with a lot of picture in a website and the size is not > always the same. > > I need some help on how to find out the size (width and height) of a > picture. Is there any way to do this (especially with PHP)? > > I need it so I can calculate the width and height to be

RE: [PHP-DB] Quarter question..

2002-11-04 Thread joakim . andersson
> On Monday 04 November 2002 19:58, [EMAIL PROTECTED] wrote: > > > $sql = "select quarter($qdate)" or die("not work #3"); > > > > change to > > $sql = "select quarter($qdate) as my_quarter"; //Added an alias to > > quarter($qdate). Easier to access that way... > > And there's no need for an 'or die

RE: [PHP-DB] Quarter question..

2002-11-04 Thread joakim . andersson
> > printf("Delete", > > $PHP_SELF, > > $myrow["id"]); > > printf(" > href=\"%s?id=%s&submit=yes\">Update%s > > %s %s", > > "update-inv.php", $myrow["id"], $myrow["name"], > > $myrow["details"], $yyy); My bad. Before this printf statement you need $my_var = mysql_fetch_array($yyy); and

RE: [PHP-DB] Quarter question..

2002-11-04 Thread joakim . andersson
> $sql = "select quarter($qdate)" or die("not work #3"); change to $sql = "select quarter($qdate) as my_quarter"; //Added an alias to quarter($qdate). Easier to access that way... And there's no need for an 'or die()' here. You're just assigning a variable and most likely this will allways work!

RE: [PHP-DB] From address in mail() header not working - ideas?

2002-10-25 Thread joakim . andersson
> Hi Guys, > > I did try that but I will try it again. > > Also, I have echo'd the data and it does appear as I expect. > > Any other thoughts while I try this? Don't know if this has anything to do with your problem, but > $headers = "Return-Path: <$support_email>\r\n"; should be > $headers .=

RE: [PHP-DB] group by day (unix timestamp provided)

2002-10-24 Thread joakim . andersson
> How can I get mySQL to group stuff by the day? my date > coloumn is a UNIX > timestamp. SELECT whatever FROM my_table GROUP BY FROM_UNIXTIME(timestamp_col, '%Y-%m-%d') Regards Joakim -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] DB Print Columns and Rows

2002-10-24 Thread joakim . andersson
> >Hello PHP people. I was wondering if I could get a > question answered? > >How would I print a Database Table into a when > the DB Table > has 4 columns, AND 4 rows. > >See I only know how to print one column. "; while($row = mysql_fetch_array($result)); {

RE: [PHP-DB] It counts everything not a specific day..

2002-10-24 Thread joakim . andersson
> OK, > > Looks like there are two options > > I can either convert the unix timestamp colomn to a mysql > time one *OR* > someone can tell me how to use unix timestamps in this query... > Try something like this: SELECT CONCAT(extract(year FROM FROM_UNIXTIME(time)), extract(month

RE: [PHP-DB] Variable won't be passed from HTTP address bar

2002-10-24 Thread joakim . andersson
> Try instead: > > if( $_POST['action'] =="test" ){ echo "Test";} > > HTH > Ignatius This should really be if( $_GET['action'] =="test" ){ echo "Test";} since it's a get-request we're dealing with... Regards Joakim -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: ht

RE: [PHP-DB] Broken Links 2

2002-10-24 Thread joakim . andersson
Hi, I think you need to remove echo $src_img; from your non working code as this is not what you want to do. And do you have support for GIF compiled in? Regards Joakim -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Help MySQL server has gone away

2002-10-01 Thread joakim . andersson
I do not think php is the problem here. Take a look here http://www.mysql.com/documentation/mysql/bychapter/manual_Problems.html#Gone _away There are some good pointers on what to do... Regards Joakim -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/u

RE: [PHP-DB] INSERTing INTO Multiple Tables with MySQL & PHP

2002-09-09 Thread joakim . andersson
Something like this, perhaps? Might be some errors in it, but you get the idea. Regards Joakim Andersson > -Original Message- > From: Graeme McLaren [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 03, 2002 5:42 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB]

RE: [PHP-DB] next prev links for search result

2002-08-27 Thread joakim . andersson
ch about performance issues, unless you have a really, really huge table. Regards Joakim Andersson -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Problem with retrieving Data with MySQL

2002-07-19 Thread joakim . andersson
ase,$sql); If this doesn't help we need to know if you have made this function and if so we probably need to see the function aswell. Regards Joakim Andersson -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Select a subset?

2002-07-17 Thread joakim . andersson
> From: Clive Bruton [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 16, 2002 10:24 PM > > Joakim, thanks, that sorted it. Just one note, "numrows" in > the sql query > should be "num_rows"? That's how I got it to work anyway. Yes, that's totally correct. Just a typo. Joakim -- PHP Database

RE: [PHP-DB] escaping line brakes

2002-07-16 Thread joakim . andersson
lace("", "\n", $your_string) If when you retrieve the data for output to the form, then just don't use nl2br(). Regards Joakim Andersson > > Thanx for any help, > > Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Select a subset?

2002-07-16 Thread joakim . andersson
while ($myrow = mysql_fetch_row($result)) { printf("%s %s%s\n", $myrow[1], $myrow[2], $myrow[3]); } echo "\n"; ?> Previous Next This oughta do it... Regards Joakim Andersson -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Date comparison problem

2002-07-11 Thread joakim . andersson
ay / month is reversed in MSSQL $str_sql = "SELECT something FROM mytable WHERE LEFT(my_datetime, 10) = '" . substr($form_date, 3, 2) . " " . substr($form_date, 0, 2) . " " . substr($form_date, 6, 4) . "'"; Regards Joakim Andersson > -Original Mess

RE: [PHP-DB] php problem passing variables

2002-07-10 Thread joakim . andersson
This doesn't look like a database question to me... Anyway, try $_POST['variable_name'] if the variable comes from a form with the POST-method $_GET['variable_name'] - Form using GET-method or passing variables in the URI (mypage.php?variable_name=42) Regards Joakim An

RE: [PHP-DB] Re: Getting Percentage of coloumn value

2002-07-10 Thread joakim . andersson
or()); ?> {$row['referer']}{$row['total_in_percentage']}"; } ?> Regards Joakim Andersson > -Original Message- > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 10, 2002 8:30 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB]

RE: [PHP-DB] MSSQL_connect() won't work

2002-07-09 Thread joakim . andersson
Does the user 'gn' exist? Are you using the correct password? Does that user have permissions on the database? Hint: "Login failed for user 'gn'" suggests that there is something wrong with that account... Regards Joakim Andersson > -Original Message