[PHP] setting word wrap

2003-12-13 Thread PAUL FERRIE
Hi guys i wonder if someone could help me with this.

http://thor.ancilenetworks.co.uk/~pferrie/vin/php/adm/
If you select table reviews and the press view database u will see that
the text goes whey out to the right of the page making the bottom scrollbar
kickin, this is not good.  When i add a new record i have to press RETURN
in a multi line text field for it to wrap in the data being sumbitted. I
thought i could set the table width wich would make the text wrap, but as u
can see this is not the case.  Can anyone give me any help with this?

cheers
Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] setting word wrap

2003-12-13 Thread PAUL FERRIE
Ah Sorted
cheers

Website Managers.Net [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Paul

What you have entered there is not normal sentence structure. Since none of
your characters have spaces between them, the browser has noplace to break
into the next line. Try typing normal sentences including spaces and you
will see that the browser will break at or near the right edge, depending on
the size of the words. Even if you hyphenate a long word, the browser will
have something to wrap.

Also, change tr width=100% bgcolor=#66tdtesting/td
TO
tr bgcolor=#66td width=95%testing/td

That will help define the margins.

Jim
www.websitemanagers.net

- Original Message -
From: PAUL FERRIE [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, December 13, 2003 3:22 PM
Subject: [PHP] setting word wrap


| Hi guys i wonder if someone could help me with this.
|
| http://thor.ancilenetworks.co.uk/~pferrie/vin/php/adm/
| If you select table reviews and the press view database u will see
that
| the text goes whey out to the right of the page making the bottom
scrollbar
| kickin, this is not good.  When i add a new record i have to press
RETURN
| in a multi line text field for it to wrap in the data being sumbitted. I
| thought i could set the table width wich would make the text wrap, but as
u
| can see this is not the case.  Can anyone give me any help with this?
|
| cheers
| Paul
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, visit: http://www.php.net/unsub.php
|
|

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Change html links according to returned result

2003-12-11 Thread PAUL FERRIE
Right here goes :(

Just when i thougfht i had done everything that had to be done the client
wants something else as well.  that something else is another 2 tables in
the database that are of a diffrent layout from the original 2. This means i
need to build a few more pages with diffrent layouts to acommidate the data
being returned, this is fine.
What my problem is:

Here is the url to the admin area
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/index.html
username: paul ferrie
pass: admin

the first 2 db's in the drop down menu are fine, it's the third and the
fourth.  I need to build a if statement that checks the name of  tablename
and then echo the relivent links
Here is the code in the links page as it is
--
?php
if (isset($_GET['tablename'])) {
echo b{$_GET['tablename']}/b loaded brBR;

} else {
 i$tablename/i did not get sent;
}
?
a href=view.php?tablename=? echo $_GET['tablename'] ?
target=mainView
database/abr
a href=search.php?tablename=? echo $_GET['tablename'] ?
target=mainSearch database/abr
a href=insert.php?tablename=? echo $_GET['tablename'] ?
target=mainInsert record/abr
a href=delete.php?tablename=? echo $_GET['tablename'] ?
target=mainDelete record/abr
a href=edit.php?tablename=? echo $_GET['tablename'] ?
target=mainEdit record/abr

-

I had a tinker about witht the code but my php is not that good i was
thinking something like:
-
?php
if (isset($_GET['tablename'])) {
echo b{$_GET['tablename']}/b loaded brBR;

} else {
 i$tablename/i did not get sent;
}
if($tablename=blah){
echoa href=view.php?tablename=? echo $_GET['tablename'] ?
target=mainView
database/abr
echoa href=search.php?tablename=? echo $_GET['tablename'] ?
target=mainSearch database/abr
echoa href=insert.php?tablename=? echo $_GET['tablename'] ?
target=mainInsert record/abr
echoa href=delete.php?tablename=? echo $_GET['tablename'] ?
target=mainDelete record/abr
echoa href=edit.php?tablename=? echo $_GET['tablename'] ?
target=mainEdit record/abr
}else if($tablename=blah2){
and so on
}
?
-

I cant get the links to echo
Any help much appreciated

cheers
Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Could some one check my code

2003-11-26 Thread PAUL FERRIE
i am getting this error returned but i dont know why :(
error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in /home/pferrie/public_html/vinrev/adm/insert2.php on line 6



php file
?php
include(connection.php);
if(!empty($rating)){
$query=SELECT * FROM $tablename WHERE rating = '$rating';
 if(mysql_query($query)) {
  $myrow = mysql_fetch_array($query);//  This line returns an error!
   $id = $myrow ['id'];
   echoError!  There is  another row in the database with a rating
value of $rating\n
You must first edit the row with a rating of $rating ! Row id =
$idbrbr;
echoa href='edit2.php?tablename=$tablenameid=$id'Edit
record/abr;
 }
  }else {
 if(!empty($_FILES['userfile']['tmp_name'])) {
 $name = strtolower(eregi_replace('#| |\?|!', '',
$_FILES['userfile']['name']));
 $destination = 'img/'.$name;
 if(move_uploaded_file($_FILES['userfile']['tmp_name'], $destination)) {
  $picture=$destination;
 $query = INSERT INTO $tablename (artist, title, picture, review,
label, format, price, rating)VALUES ('$artist', '$title', '$picture',
'$review', '$label', '$format', '$price', '$rating');
 if(!mysql_query($query)) {
   fail(Error updating DB1);
 }
  Header(Location: main.php?success=New row has been inserted into the
database);
  }
  }
 if(empty($userfile)) {
 $query2 = INSERT INTO $tablename (artist, title, picture, review,
label, format, price, rating)VALUES ('$artist', '$title', '$picture',
'$review', '$label', '$format', '$price', '$rating');
 if(!mysql_query($query2)) {
   fail(Error updating DB2);
   }
  Header(Location: main.php?success=New row has been inserted into the
database);

 }
}
?


I am trying to check for a duplicate entry for rating and if one is found
grab the row ID and then use it to load the edit page for the row.

Anyone
Cheers
Paul


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Textfields dont fully populate

2003-11-22 Thread PAUL FERRIE
Hello again guys

   This week i have been on here and  made a few posts regarding a small
admin site app
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html

Most of it is now working thank god, but still have have problems fully
populating the textfields when i go to edit a record.
Only one of the fields fully populates with the data returned from the
$query
If i view the source file via the broswer(right click / view source) i can
see that the data has been sent ok
input type='text' name='format' size=25 maxlength=25 value=cd format
But all i see is cd
Anyone

cheers

Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Textfields dont fully populate

2003-11-22 Thread PAUL FERRIE
Sorry m8 i am a total newbie to php+html,
I dont get these problems with PHP+Flash

Here is the code i am using to return the edit page with the data.

$result = mysql_query(SELECT * FROM $tablename WHERE id= $id)or
die(brther was an errorbr
   tablename:= $tablenamebr
   row id:= $id);


if ($myrow = mysql_fetch_array($result)) {
  echo form method='post' action='edit3.php?tablename=$tablename'\n;
  do {
printf(input type='hidden' name='id' value=%s
 Artist brinput type='text' name='artist' size=25 maxlength=25
value=%sbr
 Title brinput type='text' name='title' size=25 maxlength=25
value=%sbr
 Picture brinput type='text' name='picture' size=25 maxlength=25
value=%sbr
 Review  brtextarea name='review' cols=30 rows=5%s/textareabr
 Labelbrinput type='text' name='label' size=25 maxlength=25 value=%sbr
 Format brinput type='text' name='format' size=25 maxlength=25
value=%sbr
 Price brinput type='text' name='price' size=10 maxlength=8 value=%sbr
 Rating brinput type='text' name='rating' size=10 maxlength=8
value=%sbr\n,
 $myrow[id],
 $artist=$myrow[artist],
 $title=$myrow[title],
 $picture=$myrow[picture],
 $review=$myrow[review],
 $lable=$myrow[label],
 $format=$myrow[format],
 $price=$myrow[price],
 $rating=$myrow[rating]);
  } while ($myrow = mysql_fetch_array($result));
 echo brinput type='submit' value='Submit' name='submit';
echo input type='reset' value='Reset' name='reset'/form\n;
}

Cheers

Paul

Bas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 Paul Ferrie [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hello again guys
 
 This week i have been on here and  made a few posts regarding a small
  admin site app
  http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
 
  Most of it is now working thank god, but still have have problems fully
  populating the textfields when i go to edit a record.
  Only one of the fields fully populates with the data returned from the
  $query
  If i view the source file via the broswer(right click / view source) i
can
  see that the data has been sent ok
  input type='text' name='format' size=25 maxlength=25 value=cd format
  But all i see is cd
  Anyone
 
  cheers
 
  Paul

 Try to do it in double quotes(the query-data)
 In an echo statement, there you must escape the double quotes.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Textfields dont fully populate

2003-11-22 Thread PAUL FERRIE
Thank you Bas, i cant believe that once again it has been down to simple
syntx
cheers


Bas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

b1.pair.com...
 Just change your code to:

 $result = mysql_query(SELECT * FROM $tablename WHERE id= $id)or
 die(brther was an errorbr
tablename:= $tablenamebr
row id:= $id);


 if ($myrow = mysql_fetch_array($result)) {
   echo form method='post' action='edit3.php?tablename=$tablename'\n;
   do {
 printf(input type='hidden' name='id' value=%s
  Artist brinput type='text' name='artist' size=25 maxlength=25
 value='%s'br
  Title brinput type='text' name='title' size=25 maxlength=25
 value='%s'br
  Picture brinput type='text' name='picture' size=25 maxlength=25
 value='%s'br
  Review  brtextarea name='review' cols=30 rows=5%s/textareabr
  Labelbrinput type='text' name='label' size=25 maxlength=25
 value='%s'br
  Format brinput type='text' name='format' size=25 maxlength=25
 value='%s'br
  Price brinput type='text' name='price' size=10 maxlength=8
 value='%s'br
  Rating brinput type='text' name='rating' size=10 maxlength=8
 value='%s'br\n,
  $myrow[id],
  $artist=$myrow[artist],
  $title=$myrow[title],
  $picture=$myrow[picture],
  $review=$myrow[review],
  $lable=$myrow[label],
  $format=$myrow[format],
  $price=$myrow[price],
  $rating=$myrow[rating]);
   } while ($myrow = mysql_fetch_array($result));
  echo brinput type='submit' value='Submit' name='submit';
 echo input type='reset' value='Reset' name='reset'/form\n;
 }

 I have not tested this, but it should work(it was a html-problem)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Form with browse for file to upload ftp

2003-11-22 Thread PAUL FERRIE
Getting bit of a regular on here :)

I am hoping that someone can point me to a script that allows me to attach a
file to be uploaded to a set dir.
I have already got the form built, except for a browse file option.
The form is part of this admin area
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
Instead of having a textfield displaying a url of the image and the admin
having to upload it sepratly i thought that i could get the admin to upload
the image via the form.  keeps it altogether.

I wouldnt know were to begin adding this to the form.  i am pretty sure
there a pre-built script that can do this.  Can someone point me to one.  i
had a quick look but came up with very little.

Cheers
Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Form with browse for file to upload ftp

2003-11-22 Thread PAUL FERRIE
I am getting this error once i run the script

Warning: move_uploaded_file(img/matrix.jpg): failed to open stream:
Permission denied in /blah/blah
Do i need to set the chmod of the img folder?

Cheers
Paul


Nathan Taylor [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
There is nothing special to be done with the form itself for it to support
file uploading aside from supply a browse field:

input type=file name=file

As for uploading it, here's some untested code:

 if(!empty($_FILES['file']['tmp_name'])) {
 $name = strtolower(eregi_replace('#| |\?|!', '',
$_FILES['file']['name']));
 $destination = 'path/to/where/you/want/the/file/saved/'.$name;
 if(move_uploaded_file($_FILES['file']['tmp_name'], $destination)) {
  echo 'Successful';
 } else {
  echo 'Failed';
 }
  }
  - Original Message -
  From: PAUL FERRIE
  To: [EMAIL PROTECTED]
  Sent: Saturday, November 22, 2003 2:04 PM
  Subject: [PHP] Form with browse for file to upload ftp


  Getting bit of a regular on here :)

  I am hoping that someone can point me to a script that allows me to attach
a
  file to be uploaded to a set dir.
  I have already got the form built, except for a browse file option.
  The form is part of this admin area
  http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
  Instead of having a textfield displaying a url of the image and the admin
  having to upload it sepratly i thought that i could get the admin to
upload
  the image via the form.  keeps it altogether.

  I wouldnt know were to begin adding this to the form.  i am pretty sure
  there a pre-built script that can do this.  Can someone point me to one.
i
  had a quick look but came up with very little.

  Cheers
  Paul

  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Form with browse for file to upload ftp

2003-11-22 Thread PAUL FERRIE
eh?

Bronislav kluèka [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 User executing the script (www-data or nobody or some other user) has to
 vave the permission to wotk with this directory.



 Brona


  I am getting this error once i run the script
 
  Warning: move_uploaded_file(img/matrix.jpg): failed to open stream:
  Permission denied in /blah/blah
  Do i need to set the chmod of the img folder?
 
  Cheers
  Paul
 
 
  Nathan Taylor [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
  There is nothing special to be done with the form itself for it to
support
  file uploading aside from supply a browse field:
 
  input type=file name=file
 
  As for uploading it, here's some untested code:
 
   if(!empty($_FILES['file']['tmp_name'])) {
   $name = strtolower(eregi_replace('#| |\?|!', '',
  $_FILES['file']['name']));
   $destination = 'path/to/where/you/want/the/file/saved/'.$name;
   if(move_uploaded_file($_FILES['file']['tmp_name'], $destination)) {
echo 'Successful';
   } else {
echo 'Failed';
   }
}
- Original Message -
From: PAUL FERRIE
To: [EMAIL PROTECTED]
Sent: Saturday, November 22, 2003 2:04 PM
Subject: [PHP] Form with browse for file to upload ftp
 
 
Getting bit of a regular on here :)
 
I am hoping that someone can point me to a script that allows
  me to attach
  a
file to be uploaded to a set dir.
I have already got the form built, except for a browse file option.
The form is part of this admin area
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
Instead of having a textfield displaying a url of the image and
  the admin
having to upload it sepratly i thought that i could get the admin to
  upload
the image via the form.  keeps it altogether.
 
I wouldnt know were to begin adding this to the form.  i am pretty
sure
there a pre-built script that can do this.  Can someone point me to
one.
  i
had a quick look but came up with very little.
 
Cheers
Paul
 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Form with browse for file to upload ftp

2003-11-22 Thread PAUL FERRIE
Got it working :)
thanks for the help

Paul

Paul Ferrie [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Getting bit of a regular on here :)

 I am hoping that someone can point me to a script that allows me to attach
a
 file to be uploaded to a set dir.
 I have already got the form built, except for a browse file option.
 The form is part of this admin area
 http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
 Instead of having a textfield displaying a url of the image and the admin
 having to upload it sepratly i thought that i could get the admin to
upload
 the image via the form.  keeps it altogether.

 I wouldnt know were to begin adding this to the form.  i am pretty sure
 there a pre-built script that can do this.  Can someone point me to one.
i
 had a quick look but came up with very little.

 Cheers
 Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] $query works but i still get a returned error

2003-11-20 Thread PAUL FERRIE
I am not sure what the problem is here.  The script runs and deletes the
relevent row but still returns DATA from albums loaded
row id 658 did not get sent
Error deleting row!
Warning: Cannot modify header information - headers already sent by (output
started at /home/pferrie/public_html/vinrev/adm/deleteid.php:2) in
/home/pferrie/public_html/vinrev/adm/deleteid.php on line 21

?
if (isset($_GET['tablename'])) {
echo DATA from b{$_GET['tablename']}/b loadedbr;
} else {
echo  i$tablename/i did not get sentbr;
}
if (isset($_GET['id'])) {
echo row id= b{$_GET['id']}/bbr;
} else {
 echo row id i$id/i did not get sentbr;
}


include(connection.php);
$query = mysql_query(DELETE FROM $tablename WHERE id= $id)or die(brther
was an errorbr   tablename:= $tablenamebr
row id:= $id);
if(!mysql_query($query)) {
echoError deleting row!);
}
Header(Location: delete.php?success=$success);

?


I am php newbie and might be missing the obviuos

Cheers Paul

example
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
Delete record


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] $query works but i still get a returned error

2003-11-20 Thread PAUL FERRIE
So your saying i should be using POST rather than GET?

John W. Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 PAUL FERRIE wrote:

  I am not sure what the problem is here.  The script runs and deletes the
  relevent row but still returns DATA from albums loaded
  row id 658 did not get sent
  Error deleting row!
  Warning: Cannot modify header information - headers already sent by
(output
  started at /home/pferrie/public_html/vinrev/adm/deleteid.php:2) in
  /home/pferrie/public_html/vinrev/adm/deleteid.php on line 21

 You get this error because you echo display messages and errors before
 trying to do a header() redirect. You can't have any output before
header().

  
  ?
  if (isset($_GET['tablename'])) {
  echo DATA from b{$_GET['tablename']}/b loadedbr;
  } else {
  echo  i$tablename/i did not get sentbr;
  }
  if (isset($_GET['id'])) {

 Take a look at your form again, you're using POST.
 if(isset($_POST['id'])) {

  echo row id= b{$_GET['id']}/bbr;
  } else {
   echo row id i$id/i did not get sentbr;

 But you must have register_globals still on because $id is set with the
 same value as $_POST['id']...

  }
 
 
  include(connection.php);
  $query = mysql_query(DELETE FROM $tablename WHERE id= $id)or
die(brther

 and that's why this query works, because $id is the correct value.

  was an errorbr   tablename:= $tablenamebr
  row id:= $id);
  if(!mysql_query($query)) {
  echoError deleting row!);
  }
  Header(Location: delete.php?success=$success);
 
  ?
 
 
  I am php newbie and might be missing the obviuos

 Might be missing the obvious, too. ;)

 --
 ---John Holmes...

 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

 php|architect: The Magazine for PHP Professionals – www.phparch.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] setting a global var so that all pages can see var

2003-11-17 Thread PAUL FERRIE
Hello again guys,  thanks for the help over the past 48 hours :)

Over the past week i have had the job of tweaking the php pages of a friends
site.  so far so good :)

Now i am onto the admin area for running the website.  I downloaded one of
the many db managers scripts from www.hotscripts.com
Luckly its a very simple app, easy to mod.  Anyways most of my php knowledge
is in conjuction with flash www.innovativedesigns.org.uk.  most of the
problems i have had here have been fairly simple to learn and fix.

Now the job this week is with php+html (total newbie to this area). most of
the problems i have been able to fix with some help from here as well.

http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html

~This is the admin area.  I manged to get the drop down menu working to
select the revelent table and then set $tablename with the result being
displayed in the next page as:
?
print MyAdmin database for i$tablename/i table;
?
The new page has 4 links to load other php files to edit,delete, view, and
add new data to the DB
On the links have:
a href=edit.php?tablename=$tablenameView database/abr

~Now in the edit.php i have :
$result = mysql_query(SELECT * FROM $tablename)or die(couldnt select
table);

$tablename is not being passed with the link.

What am i missing?


Cheers
Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] setting a global var so that all pages can see var

2003-11-17 Thread PAUL FERRIE
lol
i not that feeling whaen it come to flash based questions  ;)

Cheers]

Burhan Khalid [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 PAUL FERRIE wrote:

  Hello again guys,  thanks for the help over the past 48 hours :)
 
  Over the past week i have had the job of tweaking the php pages of a
friends
  site.  so far so good :)
 
  Now i am onto the admin area for running the website.  I downloaded one
of
  the many db managers scripts from www.hotscripts.com
  Luckly its a very simple app, easy to mod.  Anyways most of my php
knowledge
  is in conjuction with flash www.innovativedesigns.org.uk.  most of the
  problems i have had here have been fairly simple to learn and fix.
 
  Now the job this week is with php+html (total newbie to this area). most
of
  the problems i have been able to fix with some help from here as well.
 
  http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
 
  ~This is the admin area.  I manged to get the drop down menu working to
  select the revelent table and then set $tablename with the result being
  displayed in the next page as:
  ?
  print MyAdmin database for i$tablename/i table;
  ?
  The new page has 4 links to load other php files to edit,delete, view,
and
  add new data to the DB
  On the links have:
  a href=edit.php?tablename=$tablenameView database/abr
 
  ~Now in the edit.php i have :
  $result = mysql_query(SELECT * FROM $tablename)or die(couldnt select
  table);
 
  $tablename is not being passed with the link.
 
  What am i missing?

 RTFM @ http://www.php.net/security.registerglobals
 STFA

 This question is another one of those twice daily ones.

 --
 Burhan Khalid
 phplist[at]meidomus[dot]com
 http://www.meidomus.com
 ---
 Documentation is like sex: when it is good,
   it is very, very good; and when it is bad,
   it is better than nothing.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] setting a global var so that all pages can see var

2003-11-17 Thread PAUL FERRIE
I am still stuck
I now have this in the navigation page
?php
if (isset($_GET['tablename'])) {
echo loaded b{$_GET['tablename']}/b;

} else {
 i$tablename/i did not get sent;
}
?
this gets the tablename from the previous page from the dropdown menu
but still the other pages are not picking it up :(
Please i need to get this working

Cheers
paul

Burhan Khalid [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 PAUL FERRIE wrote:

  Hello again guys,  thanks for the help over the past 48 hours :)
 
  Over the past week i have had the job of tweaking the php pages of a
friends
  site.  so far so good :)
 
  Now i am onto the admin area for running the website.  I downloaded one
of
  the many db managers scripts from www.hotscripts.com
  Luckly its a very simple app, easy to mod.  Anyways most of my php
knowledge
  is in conjuction with flash www.innovativedesigns.org.uk.  most of the
  problems i have had here have been fairly simple to learn and fix.
 
  Now the job this week is with php+html (total newbie to this area). most
of
  the problems i have been able to fix with some help from here as well.
 
  http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
 
  ~This is the admin area.  I manged to get the drop down menu working to
  select the revelent table and then set $tablename with the result being
  displayed in the next page as:
  ?
  print MyAdmin database for i$tablename/i table;
  ?
  The new page has 4 links to load other php files to edit,delete, view,
and
  add new data to the DB
  On the links have:
  a href=edit.php?tablename=$tablenameView database/abr
 
  ~Now in the edit.php i have :
  $result = mysql_query(SELECT * FROM $tablename)or die(couldnt select
  table);
 
  $tablename is not being passed with the link.
 
  What am i missing?

 RTFM @ http://www.php.net/security.registerglobals
 STFA

 This question is another one of those twice daily ones.

 --
 Burhan Khalid
 phplist[at]meidomus[dot]com
 http://www.meidomus.com
 ---
 Documentation is like sex: when it is good,
   it is very, very good; and when it is bad,
   it is better than nothing.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: setting a global var so that all pages can see var still :(

2003-11-17 Thread PAUL FERRIE
How would i pass tablename in the submit button?
Check out edit record u wil see
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html

Cheers
Paul

Paul Ferrie [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello again guys,  thanks for the help over the past 48 hours :)

 Over the past week i have had the job of tweaking the php pages of a
friends
 site.  so far so good :)

 Now i am onto the admin area for running the website.  I downloaded one of
 the many db managers scripts from www.hotscripts.com
 Luckly its a very simple app, easy to mod.  Anyways most of my php
knowledge
 is in conjuction with flash www.innovativedesigns.org.uk.  most of the
 problems i have had here have been fairly simple to learn and fix.

 Now the job this week is with php+html (total newbie to this area). most
of
 the problems i have been able to fix with some help from here as well.

 http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html

 ~This is the admin area.  I manged to get the drop down menu working to
 select the revelent table and then set $tablename with the result being
 displayed in the next page as:
 ?
 print MyAdmin database for i$tablename/i table;
 ?
 The new page has 4 links to load other php files to edit,delete, view, and
 add new data to the DB
 On the links have:
 a href=edit.php?tablename=$tablenameView database/abr

 ~Now in the edit.php i have :
 $result = mysql_query(SELECT * FROM $tablename)or die(couldnt select
 table);

 $tablename is not being passed with the link.

 What am i missing?


 Cheers
 Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] newbie stuck again

2003-11-16 Thread PAUL FERRIE
Here's what i have done.  i have downloaded a very simple database manager
from www.hotscripts.com.  It allows me to edit, delete and add new
information to the database.  i have a couple of problems.

1.  form field dont fill with all the data senback from the db to be edited,
as fars as i am aware all fields except 'review' are long enough

2. In my common.php file for connecting to the db i have


?

$database=mysql_connect (localhost, blah, ) or die ('I cannot
connect to the database because: ' . mysql_error());
mysql_select_db (***_vinrev);

$tablename=albums;
?

I have 2 tables in my database and would like to use a drop down menu to
select the table we wish to view and edit.  so taken $tablename out of the
common.php file and having it sset within the main navigation.  i am pretty
sure i can set the drop down menu option but what is/would be the  $query
for returning how many and display table names?

Cheers
Paul
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] newbie stuck again

2003-11-16 Thread PAUL FERRIE
Yeh cheers derek i dint think it would be something like that :P
Can u ilabirate more on the $query structure?

cheers
Paul

Derek Ford [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 PAUL FERRIE wrote:

 Here's what i have done.  i have downloaded a very simple database
manager
 from www.hotscripts.com.  It allows me to edit, delete and add new
 information to the database.  i have a couple of problems.
 
 1.  form field dont fill with all the data senback from the db to be
edited,
 as fars as i am aware all fields except 'review' are long enough
 
 2. In my common.php file for connecting to the db i have
 
 
 ?
 
 $database=mysql_connect (localhost, blah, ) or die ('I cannot
 connect to the database because: ' . mysql_error());
 mysql_select_db (***_vinrev);
 
 $tablename=albums;
 ?
 
 I have 2 tables in my database and would like to use a drop down menu
to
 select the table we wish to view and edit.  so taken $tablename out of
the
 common.php file and having it sset within the main navigation.  i am
pretty
 sure i can set the drop down menu option but what is/would be the  $query
 for returning how many and display table names?
 
 Cheers
 Paul
 http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
 
 
 
 your probably looking for something like 'show tables'.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] newbie stuck again

2003-11-16 Thread PAUL FERRIE
Cheers

Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Sunday 16 November 2003 23:17, PAUL FERRIE wrote:

 Please spend a little time to think up a descriptive and relevant subject
 heading. newbie stuck again does nothing to inform people of what your
 problem is.

  Here's what i have done.  i have downloaded a very simple database
manager
  from www.hotscripts.com.  It allows me to edit, delete and add new
  information to the database.  i have a couple of problems.
 
  1.  form field dont fill with all the data senback from the db to be
  edited, as fars as i am aware all fields except 'review' are long enough

 Can't help you unless you show some code. The most cause of this is
because
 you're not producing correct HTML, in particular you should enclose the
 values of the attributes in quotes.

  i am pretty
  sure i can set the drop down menu option but what is/would be the
$query
  for returning how many and display table names?

 mysql_list_tables(), but read the manual entry before using.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 The difference between a Miracle and a Fact is exactly the difference
 between a mermaid and a seal.
 -- Mark Twain
 */

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] create dropdown menu from returned $result

2003-11-16 Thread PAUL FERRIE
What am i overlooking?

?
include('common.php');
$result = mysql_list_tables(***_vinrev);
$i = 0;
while ($i  mysql_num_rows ($result)) {
$tb_names[$i]= mysql_tablename ($result, $i);
 echo SELECT NAME='$tablename';

  echo OPTION VALUE=\.$tb_names[$i].\.
  $tb_names[$i]. /OPTION ;
  echo $tb_names[$i] . BR;
   $i++;
  }
   echo /SELECT;
?


When tested
heres what i get
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/table_list.php
There are 2 tables within the DB 'reviews', 'albums'

Cheers
Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] create dropdown menu from returned $result

2003-11-16 Thread PAUL FERRIE
I am trying to create a drop down menu to set varaible $tablrname

Cheers

paul

John W. Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 PAUL FERRIE wrote:

  What am i overlooking?

 The part where you tell us what you're actually trying to achieve...

  ?
  include('common.php');
  $result = mysql_list_tables(***_vinrev);
  $i = 0;
  while ($i  mysql_num_rows ($result)) {
  $tb_names[$i]= mysql_tablename ($result, $i);
   echo SELECT NAME='$tablename';
 
echo OPTION VALUE=\.$tb_names[$i].\.
$tb_names[$i]. /OPTION ;
echo $tb_names[$i] . BR;

 Why are you echoing data and displaying br between select and
 /select... That's bad HTML.

 $i++;
}
 echo /SELECT;
  ?
 
 
  When tested
  heres what i get
  http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/table_list.php
  There are 2 tables within the DB 'reviews', 'albums'

 So I see a select box with two options, 'reviews' and 'albums' that's
 made from badly formed HTML. What are you trying to accomplish??

 --
 ---John Holmes...

 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

 php|architect: The Magazine for PHP Professionals – www.phparch.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Alternet row colors

2003-11-15 Thread PAUL FERRIE
Hello all

I have been working on this website
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm
I did not design the site i have just been asked to tweak it
My php knowledge is limited always learning something new.  Anyways I have
been trying to use a code that i got from
www.hotscripts.com the scipts retutns alternet rows colors for information
sent back from the database when displayed in the broswer.

Here is the script:
//---


function alternate_rows(
// color_1 and color_2 have default values, but can be over-ridden.
$data,
$color_1 = '#99',
$color_2 = 'black'
)
{
// Declare $color as static so it retains its value when program
// execution leaves the local function's scope.
static $color;

// Set the color to that's not currently set.
if ( $color == $color_1 )
{
$color = $color_2;
}
else
{
$color = $color_1;
}

echo 'tr bgcolor=' . $color . 'td' . $data . '/td/tr';
}

I have tried a few was of implamenting this into my current php code but i
have had no luck :(


Could some one help me with this please :)
If you check the website and click top ten
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm


The code for return the top ten result is :
$result = mysql_query(SELECT * FROM albums where id 15);

$Count = @mysql_num_rows($result);

 echo table border=1 cellpadding=3 cellspacing=0
bordercolor='#00'\n;
echo trtd bgcolor='#66'ID/tdtd
bgcolor='#66'ARTIST/tdtd bgcolor='#66'TITLE/tdtd
bgcolor='#66'LABEL/tdtd bgcolor='#66'PRICE/td/tr\n;

for ($count = 0; $count  $Count; $count++) {
// Extract post details from database
$myrow = mysql_fetch_array($result);
$id = $myrow ['id'];
   $artist = $myrow ['artist'];
 $title = $myrow ['title'];
 $label = $myrow ['label'];
 $price = $myrow ['price'];

printf(tr
bgcolor='#00'td$id/tdtd$artist/tdtd$title/tdtd$label/td
td£$price/tr\n);
}
 echo /table\n;

?

Cheers
Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Alternet row colors

2003-11-15 Thread PAUL FERRIE
Thats pretty much what i have got off www.hotscripts.com.  The problem is
adding it to my exsisting code.

~cheers
Paul

Boaz Yahav [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
You can also check :

A PHP function To Make Alternative Colored table rows
http://www.weberdev.com/get_example.php3?count=3609

Alternating background color for HTML table rows
http://www.weberdev.com/get_example.php3?count=3482

Another way to alternate table rows
http://www.weberdev.com/get_example.php3?count=1832

How to display any array in several rows and columns of a table. Not just in
one column or in alternate rows. This example shows a nice color table
generated with PHP, but can be used with any array values(e.g. Database)
http://www.weberdev.com/get_example.php3?count=1761

HTML Table with random alternating colours, helps you see what you colour
options are.
http://www.weberdev.com/get_example.php3?count=1555

Sincerely

berber

Visit http://www.weberdev.com/  http://www.weberblog.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com
Share your thoughts :
http://www.weberblog.com/submit.php?type=storytopic=PHP_Web_Logs



-Original Message-
From: PAUL FERRIE [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 15, 2003 5:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Alternet row colors


Hello all

I have been working on this website
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm
I did not design the site i have just been asked to tweak it
My php knowledge is limited always learning something new.  Anyways I have
been trying to use a code that i got from www.hotscripts.com the scipts
retutns alternet rows colors for information sent back from the database
when displayed in the broswer.

Here is the script:
//---


function alternate_rows(
// color_1 and color_2 have default values, but can be over-ridden.
$data,
$color_1 = '#99',
$color_2 = 'black'
)
{
// Declare $color as static so it retains its value when program //
execution leaves the local function's scope.
static $color;

// Set the color to that's not currently set.
if ( $color == $color_1 )
{
$color = $color_2;
}
else
{
$color = $color_1;
}

echo 'tr bgcolor=' . $color . 'td' . $data . '/td/tr'; }

I have tried a few was of implamenting this into my current php code but i
have had no luck :(


Could some one help me with this please :)
If you check the website and click top ten
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm


The code for return the top ten result is :
$result = mysql_query(SELECT * FROM albums where id 15);

$Count = @mysql_num_rows($result);

 echo table border=1 cellpadding=3 cellspacing=0
bordercolor='#00'\n;
echo trtd bgcolor='#66'ID/tdtd
bgcolor='#66'ARTIST/tdtd bgcolor='#66'TITLE/tdtd
bgcolor='#66'LABEL/tdtd bgcolor='#66'PRICE/td/tr\n;

for ($count = 0; $count  $Count; $count++) {
// Extract post details from database
$myrow = mysql_fetch_array($result);
$id = $myrow ['id'];
   $artist = $myrow ['artist'];
 $title = $myrow ['title'];
 $label = $myrow ['label'];
 $price = $myrow ['price'];

printf(tr
bgcolor='#00'td$id/tdtd$artist/tdtd$title/tdtd$label/td
td£$price/tr\n);
}
 echo /table\n;

?

Cheers
Paul

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] quick i need some help please

2003-10-01 Thread PAUL FERRIE
i have a admin section for a new site that i have built, to cut a long story
short
the submit form adds news stories to the site.  For some reason behound me
the php script is converting  to a square.
It is a flash based admin area not yet sure if this is an issuse, i just got
the call :(
the font being used is a system defult font (arial).

thanks
Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: quick i need some help please

2003-10-01 Thread PAUL FERRIE
False alarm !

Paul Ferrie [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 i have a admin section for a new site that i have built, to cut a long
story
 short
 the submit form adds news stories to the site.  For some reason behound me
 the php script is converting  to a square.
 It is a flash based admin area not yet sure if this is an issuse, i just
got
 the call :(
 the font being used is a system defult font (arial).

 thanks
 Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] is this possible?

2003-09-27 Thread \[ PAUL FERRIE \]
Hi guys,
I am have created several websites(flash) with admin areas so that the
clients can update sections of there site.

I have created a little admin section on my own site(yet to be published).
there is a client login area for client who's site's i have built. Here they
have the option to change the login details for ther on DB's, follow?
So far i have go it working.  Details get updated on my server DB.
Now it gets tricky for me.
I am trying to figure out the best way of  updating the clients db(Diffrent
server) with the new login details.

I thought i would do something like

php:// Updates clients details on my DB server
?php
//Select wich common file to include
// this will be sent by flash
$common1=http://www.server1.com/php/common.php;;
$common2=http://www.server2.com/php/common.php;;
$common3=http://www.server3.com/php/common.php;;
$common4=http://www.server4.com/php/common.php;;
//
include('$common1');//one of the four above
$link = dbConnect();
// Attempt to authorise user with database
$userID = auth($username, $password);
// If authorisation failed...
if ($userID == -1) {
// Inform Flash and quit
fail(Invalid username and/or password);
}
//set new username and password
$crypt2 = md5($password2);
$query = UPDATE admin SET username = '$username2', password = '$crypt2'
WHERE userID = '$userID';
if(!mysql_query($query)) {
fail(Error updating admin);
}

print retval=1;
?
Can the common.php file and the variables in this code be sent across the
server?
One other thing
The Db's on the four severs are identical
I hope i have explained what i am trying to do.

cheers

Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] date conflict with old news archive

2003-09-23 Thread \[ PAUL FERRIE \]
God i hope this is simple :)
I have news bloggs section on my site.  At present the news is loaded in
from a txt file,  most of the site is now running with most sections being
loaded via mysqldb's.
I would like to add the old entries to the new db that i have setup for the
bloggs.
My problem is converting the date format from 12-08-03 to the time stamp to
be stored int the db.  It has to be done this way as new entries will be
using the time stamp

So in the php file i have
$dateAdded =  time();
but time would then be 1064245532
i need
date=12-08-03
$dateAdded = date(convert) to time stamp

cheers
Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] date conflict with old news archive

2003-09-23 Thread PAUL FERRIE
Cheers your a star :)

Eugene Lee [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Tue, Sep 23, 2003 at 09:01:19PM +0100, [ PAUL FERRIE ] wrote:
 :
 : God i hope this is simple :)

 It is.  I think.  :-)

 : I have news bloggs section on my site.  At present the news is loaded in
 : from a txt file,  most of the site is now running with most sections
being
 : loaded via mysqldb's.
 : I would like to add the old entries to the new db that i have setup for
the
 : bloggs.
 : My problem is converting the date format from 12-08-03 to the time stamp
to
 : be stored int the db.  It has to be done this way as new entries will be
 : using the time stamp
 :
 : So in the php file i have
 : $dateAdded =  time();
 : but time would then be 1064245532
 : i need
 : date=12-08-03
 : $dateAdded = date(convert) to time stamp

 $dateAdded = mktime(0, 0, 0, 12, 8, 2003);

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] simple query help

2003-07-05 Thread Paul Ferrie
Hi guys,
I am working on a flash forum for my site.  Came with the FOED book,

anyways i am tyring to delete the threadCount by -1 from the db.
could below does dlete the count but in multipules of 2.

Anyone

cheers

$query = UPDATE forumForums SET threadCount = threadCount -1 WHERE forumID
= $forumID;
if(!mysql_query($query)) {
fail(Error deleting thread Count);
}
$result = @mysql_query($query);




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] simple flash php form, help please

2003-06-22 Thread Paul Ferrie
Hi again guys :)

I am having problems with this little email user script for my website. I
have set this script here to run with flash outputing the information. When
i run the script in the browser i grt this error
Warning: Failed to Receive in C:\apache\htdocs\innovat\forum\mailuser.php
on line 18
I aint any php expert just some simple stuff i know.
You can copy the code and test it just change the email information.

cheers for any help guys.

?
$username = djd;// set these two so that we do not need flash to output
the information
$users_email=[EMAIL PROTECTED];
$ToEmail = $users_email;
$date = date(m/d/Y H:i:s);
$ToName = $username;// out put from flash
$ToSubject = Email from mywebsite.co.uk;
$email = [EMAIL PROTECTED];
$msg = Type whatever here;


$EmailBody = Sent By: $username\n\nMessage Sent:\n$msg\n\n;

$EmailFooter=\nSent on\n Date/Time:  $date;

$Message = $EmailBody.$EmailFooter;

mail($ToName. .$ToEmail.,$ToSubject, $Message, From: .$username.
.$email.);// line 18


print retval=1$ToEmailToSubject$Message$username$email;// This just
returns output to show all variables have been passed ok.

?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] what can i store in the DB

2003-06-11 Thread - \[ Paul Ferrie \] -
Hi guys,

I am not really an expert in this I just learn what I need to know when I
need to know it.

I am building a flash tutorials section for my site
http://www.innovativedesigns.org.uk
The section is my first real attempt at using php+mysql without having to
check the books or reference files :)
Anyway here is my question:

Can images be stored in the DB
I am thinking no. This would me a long way round what I am trying to do.

cheers




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] what can i store in the DB

2003-06-11 Thread Paul Ferrie
cheers m8
Just what i was looking for :)

Thanx again

Awlad Hussain [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Paul
 check the tutorial on Storing Images in Database
  http://codewalkers.com/tutorials/35/2.html

 good luck.. BTW cool flash work :)


 - Original Message -
 From: - [ Paul Ferrie ] - [EMAIL PROTECTED]
 To: Awlad Hussain [EMAIL PROTECTED]
 Sent: Wednesday, June 11, 2003 12:05 PM
 Subject: Re: [PHP] what can i store in the DB


  I did use www.mysql.com Search querystoring images, store image, image
  storing  it didnt come back with very much, so the post on php was my
  last resort.
 
  thanx for the quick reply
 
  Paul
 
  - Original Message -
  From: Awlad Hussain [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]; - [ Paul Ferrie ] -
  [EMAIL PROTECTED]
  Sent: Wednesday, June 11, 2003 11:56 AM
  Subject: Re: [PHP] what can i store in the DB
 
 
   You can store image as BLOB in DB
   I would recomend you download mysql manual from www.mysql.com, very
 useful
  
   awlad
   - Original Message -
   From: - [ Paul Ferrie ] - [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Wednesday, June 11, 2003 11:46 AM
   Subject: [PHP] what can i store in the DB
  
  
Hi guys,
   
I am not really an expert in this I just learn what I need to know
 when
  I
need to know it.
   
I am building a flash tutorials section for my site
http://www.innovativedesigns.org.uk
The section is my first real attempt at using php+mysql without
having
  to
check the books or reference files :)
Anyway here is my question:
   
Can images be stored in the DB
I am thinking no. This would me a long way round what I am trying to
 do.
   
cheers
   
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] flash and php (using the varibles)

2003-01-09 Thread - \[ Paul Ferrie \] -
Hi guys i hope there is someone in here that use flsah along with php to
help with this :)

Anyway i will make it simple.

mysql returns a number say 123 i want flash to take this number to animate a
progress bar, but here the problem it does work but the progress bar dosn't
animate it just sets to the hieght of the numbers sent back from mysql.  How
can i slow down the animation of the progress bar

Anyone



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] strange problem (user poll)

2003-01-08 Thread - \[ Paul Ferrie \] -
Can anyone see a problem in this?  When i run the script i am getting this
error Notice: Undefined variable: action in
C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13

?
// addpoll.php
// Case Study 1: User Poll - Foundation PHP for Flash

// If the form has been submitted...
(line 13) if ($action == add) {
// Include config file
include('common.php');

// Connect to database
$link = dbConnect();

// Get date for new poll
$posted = time();

// Build query to insert new poll
$query = INSERT INTO polls (question, option1, option2, option3,
posted)
  VALUES('$question', '$option1', '$option2', '$option3',
$posted);

// Execute query
$result = @mysql_query($query);

// If query failed...
if (!$result) {
// Display error
print font color=\#ff\Could not insert poll/fontbr\n;
} else {
print font color=\#ff\Poll added/fontbr\n;
}

mysql_close($link);
}
?
please anyone



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: strange problem (user poll)

2003-01-08 Thread - \[ Paul Ferrie \] -
Sorry guys ingore the post, i have narrowed the problem down to a problem
with posting the vairables from flash.
cheers

- - [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Can anyone see a problem in this?  When i run the script i am getting this
 error Notice: Undefined variable: action in
 C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13

 ?
 // addpoll.php
 // Case Study 1: User Poll - Foundation PHP for Flash

 // If the form has been submitted...
 (line 13) if ($action == add) {
 // Include config file
 include('common.php');

 // Connect to database
 $link = dbConnect();

 // Get date for new poll
 $posted = time();

 // Build query to insert new poll
 $query = INSERT INTO polls (question, option1, option2, option3,
 posted)
   VALUES('$question', '$option1', '$option2', '$option3',
 $posted);

 // Execute query
 $result = @mysql_query($query);

 // If query failed...
 if (!$result) {
 // Display error
 print font color=\#ff\Could not insert
poll/fontbr\n;
 } else {
 print font color=\#ff\Poll added/fontbr\n;
 }

 mysql_close($link);
 }
 ?
 please anyone





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] $query help :(

2003-01-08 Thread - \[ Paul Ferrie \] -
Hi again guys i have run into another problem :(

i am trying to build a user poll (flash+php+mysql)
I have the interface all sorted but i have a problem with my add new poll
php file.
When i hit the update poll button in flash it seem that everthing has work
and it' send back a msg saying all went well :).  but when i check with
phpmyadmin i see that the $query has been successfully added but the
question,opt1,opt2,opt3 fields are blank no data added. the only
fields to be added were the auto_id and date stamp
below is a sample code of the php file and after that you will see the code
on the button.

[php]
if ($action == add) {
// Include config file
include('common.php');

// Connect to database
$link = dbConnect();

// Get date for new poll
$posted = time();

// Build query to insert new poll
$query = INSERT INTO polls (question, option1, option2, option3,
posted) VALUES ('$quest1', '$opt1', '$opt2', '$opt3', $posted);

// Execute query
$result = @mysql_query($query);

// If query failed...
if (!$result) {
// Display error
print result=Could not insert poll;
} else {
print result=poll created;
}

mysql_close($link);
}
?
[/php]

on the button in Flash i have
[code]
on (release) {
 if (!quest1.length) {
  result = fields missing;
 }
 if (!opt1.length) {
  result = fields missing;
 }
 if (!opt2.length) {
  result = fields misasing;
 }
 if (!opt3.length) {
  result = fields missing;
 } else {
  loadVariables(addpoll.php, this, POST);
  gotoAndPlay(2);
 }
}

[/code]

I have tried everything i can think of but i cab't seem to get it working.
Can anyone see anything i am missing?
Cheers




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: strange problem (user poll)

2003-01-08 Thread - \[ Paul Ferrie \] -
It seem there is some probs with the latest release of php something about
global vars.

Jst checked and it works now.  It was the php thing right enough.  i hope
that my server admin have done the same thing with the php.ini

cheers guys.

- - [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Can anyone see a problem in this?  When i run the script i am getting this
 error Notice: Undefined variable: action in
 C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13

 ?
 // addpoll.php
 // Case Study 1: User Poll - Foundation PHP for Flash

 // If the form has been submitted...
 (line 13) if ($action == add) {
 // Include config file
 include('common.php');

 // Connect to database
 $link = dbConnect();

 // Get date for new poll
 $posted = time();

 // Build query to insert new poll
 $query = INSERT INTO polls (question, option1, option2, option3,
 posted)
   VALUES('$question', '$option1', '$option2', '$option3',
 $posted);

 // Execute query
 $result = @mysql_query($query);

 // If query failed...
 if (!$result) {
 // Display error
 print font color=\#ff\Could not insert
poll/fontbr\n;
 } else {
 print font color=\#ff\Poll added/fontbr\n;
 }

 mysql_close($link);
 }
 ?
 please anyone





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] php $query help

2003-01-06 Thread - \[ Paul Ferrie \] -
 Here is my problem

I have created a user login system (flash+php+mysql)
And it just about works

Here's the prob when i go to register as a new user the code wont properly
check to see if the username already exsist's in the DB, I am pretty sure
the problem lies in my first $query


PHP:
--
$query = SELECT name FROM contacts WHERE name='$name';
if ($name == $name) {
print loginT=UserName in Use;
}else{
$query = INSERT INTO contacts (name, pass, email, id) VALUES ('$name',
'$pass', '$email', NULL);;
}
$result = mysql_query($query);
// Gets the number of rows affected by the query as a check.
$numR = mysql_affected_rows($Connect);
if ($numR == 0) {
// Sends output to flash
print loginT=Error - Register Again;
}
else if ($numR == 1) {
// Sends output to flash
print loginT=Successchecklog=1;
}


--


If i take out
PHP:
--
$query = SELECT name FROM contacts WHERE name='$name';
if ($name == $name) {
print loginT=UserName in Use;


--

THe login system works fine but dupilcate entries can be submitted to the
database.

Please help i would love to get this up and running

Cheers



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] time stamp screwing up

2003-01-06 Thread - \[ Paul Ferrie \] -
hey guys could someone help me
I have created a user login register system in  flash with PHP and Mysql.
Everthing Now works fine aprt from the time stamp of when the user
registered.

Code ---
// Get current date  time
$time = time();
// Connects to the Database.
$Connect = mysql_connect($dbServer, $dbUser, $dbPass);
mysql_select_db($dbName);
// Preforms the SQL query to see if user name already exsists
$query = SELECT name FROM contacts WHERE name='$name';
$rs_contacts = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_assoc($rs_contacts);
if ($row[name] == $name) {
print loginT=UserName in Usechecklog=2;
}else{
$query = INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
(NULL, '$name', '$pass', '$email', '$time');
}


It inserts -00-00
instead of the current date

ideas

P.S
I am a newbie try keeping reponse's simple please



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] time stamp screwing up

2003-01-06 Thread - \[ Paul Ferrie \] -
nope it still comes up with all the zero's

:(

Stephan Seidt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 What sort of mysql field type did you use for dateAdded ?
 You need UNIX_TIMESTAMP (or sth like that) for unix timestamp format.

 - [ Paul Ferrie ] - wrote:
  hey guys could someone help me
  I have created a user login register system in  flash with PHP and
Mysql.
  Everthing Now works fine aprt from the time stamp of when the user
  registered.
 
  Code ---
  // Get current date  time
  $time = time();
  // Connects to the Database.
  $Connect = mysql_connect($dbServer, $dbUser, $dbPass);
  mysql_select_db($dbName);
  // Preforms the SQL query to see if user name already exsists
  $query = SELECT name FROM contacts WHERE name='$name';
  $rs_contacts = mysql_query($query) or die(mysql_error());
  $row = mysql_fetch_assoc($rs_contacts);
  if ($row[name] == $name) {
  print loginT=UserName in Usechecklog=2;
  }else{
  $query = INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
  (NULL, '$name', '$pass', '$email', '$time');
  }
 
 
  It inserts -00-00
  instead of the current date
 
  ideas
 
  P.S
  I am a newbie try keeping reponse's simple please
 
 
 


 --
 When ipv6 and tcpa are there.. When this Palladium server wrecks..
 I won't be able to drink my coffe then!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] time stamp screwing up

2003-01-06 Thread - \[ Paul Ferrie \] -
So Jason what your saying is this

$query = INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
 (NULL, '$name', '$pass', '$email', '$time');
Should be

$query = INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
 (NULL, '$name', '$pass', '$email', NOW());

??
cheers


Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Tuesday 07 January 2003 00:19, - \[ Paul Ferrie \] - wrote:
  hey guys could someone help me
  I have created a user login register system in  flash with PHP and
Mysql.
  Everthing Now works fine aprt from the time stamp of when the user
  registered.
 
  Code ---
  // Get current date  time
  $time = time();
  // Connects to the Database.
  $Connect = mysql_connect($dbServer, $dbUser, $dbPass);
  mysql_select_db($dbName);
  // Preforms the SQL query to see if user name already exsists
  $query = SELECT name FROM contacts WHERE name='$name';
  $rs_contacts = mysql_query($query) or die(mysql_error());
  $row = mysql_fetch_assoc($rs_contacts);
  if ($row[name] == $name) {
  print loginT=UserName in Usechecklog=2;
  }else{
  $query = INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
  (NULL, '$name', '$pass', '$email', '$time');
  }
 
 
  It inserts -00-00
  instead of the current date

 What column type is dateAdded? If it's a mysql DATE type then you should

 replace:

   '$time'

 with

   NOW()

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 It's more than magnificent -- it's mediocre.
 -- Sam Goldwyn
 */




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] time stamp screwing up

2003-01-06 Thread - \[ Paul Ferrie \] -
So

Is NOW() a mysql function?
Stephan Seidt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 yep i guess that, so NOW() is a mysql function.

 - [ Paul Ferrie ] - wrote:
  So Jason what your saying is this
 
  $query = INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
 
 (NULL, '$name', '$pass', '$email', '$time');
 
  Should be
 
  $query = INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
 
 (NULL, '$name', '$pass', '$email', NOW());
 
 
  ??
  cheers
 
 
  Jason Wong [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
 On Tuesday 07 January 2003 00:19, - \[ Paul Ferrie \] - wrote:
 
 hey guys could someone help me
 I have created a user login register system in  flash with PHP and
 
  Mysql.
 
 Everthing Now works fine aprt from the time stamp of when the user
 registered.
 
 Code ---
 // Get current date  time
 $time = time();
 // Connects to the Database.
 $Connect = mysql_connect($dbServer, $dbUser, $dbPass);
 mysql_select_db($dbName);
 // Preforms the SQL query to see if user name already exsists
 $query = SELECT name FROM contacts WHERE name='$name';
 $rs_contacts = mysql_query($query) or die(mysql_error());
 $row = mysql_fetch_assoc($rs_contacts);
 if ($row[name] == $name) {
 print loginT=UserName in Usechecklog=2;
 }else{
 $query = INSERT INTO contacts (id, name, pass, email, dateAdded)
VALUES
 (NULL, '$name', '$pass', '$email', '$time');
 }
 
 
 It inserts -00-00
 instead of the current date
 
 What column type is dateAdded? If it's a mysql DATE type then you should
 
 replace:
 
   '$time'
 
 with
 
   NOW()
 
 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 
 /*
 It's more than magnificent -- it's mediocre.
 -- Sam Goldwyn
 */
 
 
 
 
 


 --
 When ipv6 and tcpa are there.. When this Palladium server wrecks..
 I won't be able to drink my coffe then!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] time stamp screwing up

2003-01-06 Thread - \[ Paul Ferrie \] -
Well i am still getting all the zero's

: ( : (

- Edwin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 - [ Paul Ferrie ] - [EMAIL PROTECTED] wrote:
  So
 
  Is NOW() a mysql function?

 Well, you can check for yourself ;)

 It should be somewhere around here:

   http://www.mysql.com/doc/en/Date_and_time_functions.html

 - E

 ...[snip]...

 __
 Do You Yahoo!?
 Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php