Re: [PHP] arg....

2001-01-26 Thread Iván Sánchez Ortega \MR\

"Kurth Bemis" ...
 At 12:31 PM 1/26/2001, Krznaric Michael wrote:

 sorry - here you all go..


 // number crunching time
 $count++;
 $time = date("Y-m-d H:i:s");

 $result = mysql_query("INSERT INTO links (count) VALUES $count WHERE
lid=$id");

 i'm having a horrible time updating 2 fields in the same db.  I don't get
 an error but the fields aren't updatedcan anyone send me a snippet
for
 the to learn from?

well, if you want to UPDATE fields into a database, then PLEASE NOT INSERT
data...

that code should look:

$result = mysql_query("UPDATE links (count) VALUES ($count) WHERE lid=$id");

i suppose that you are getting $count from the DB before doing $count++; ...

and also have a look at the data types of that table... if the column
'count' is not of NUMBER type, you'll need some quotes in the query... also
applies for the lid.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mixing HTML and PHP code

2001-01-16 Thread Iván Sánchez Ortega \MR\

"Alex Black" ...
  the horse is back from the dead!
 
 huh?

 inside joke.

Doh.

   I don't like to do database connections when I've already output
markup,
   what if something goes wrong, or I want to do a redirect, etc?
 
  If something goes wrong - It's the DBA fault. :-)

 hehe

 in a production encironment: agh!

But if you're a freelancer and the DBA works for the web-hosting enterprise,
it can be very funny!

  I'm pretty comfortable programming directly with OCIwhatever() functions
  directly in the main code, that's it.

 ok, go ahead. that in my opinion is not the way to go, especially for
 portability and reuse of code... it's also the quick route to hair-pulling
 if you QA your code...

portability to other platform = search-replace OCIwhatever to mysqlwhatever.
reuse of code = copy-paste-modify

:-D

You don't know what hellish programming gadgets i had to invent in order to
make some places of "my" website to work...

  In other words, i don't need to make my code more maintainable because
i'm
  comfortable with maintaining it right now.

 well, then why bother arguing the point?

Dunno.

 my opinion only matters if you care about it?

Only matters to who??

 otherwise I'm just babbling. (ohh I see some responses to this one)

C'mon, people, reply to this one and make Alex happy!!!


  True, but why not just bitch at macromedia until they include support
for
  PHP in ultradev?
 
  (Well, i haven't purchased dreamweaver either)

 good, that means you're not using any diabolical visual tools :)

Well, you can always call M$ windoze a "diabolical visual OS" :-)

  (plegh, visual authoring tools: a necessary evil)
 
  Why, when you have notepad.exe and a couple of browsers to test that the
  pages work properly?

 whoa, dude.

Yeah. Since i learnt pure HTML code, and having seen what a *clean* code
generates M$ frontpage, i decided not to work with *any* visual web page
generator.

Perhaps i'm extrapolating, but i did it it way, and now it could be hard for
me to change.

 that's scary. but do whatever you want!

Well, it's my style right now, and that way i'm going well. Perhaps i'll
change with time, but...





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mixing HTML and PHP code

2001-01-15 Thread Iván Sánchez Ortega \MR\

"Alex Black" ...
 the horse is back from the dead!

huh?

  And aside from that, i don't have a one and only common_head.php ... i
have
  a separate plain common head, in plain HTML... the real common_head.php
  should look like (definitively not real PHP sintax):

 right, and though this is not directly related to templating:

 I thik you would benefit greatly by introducing some system design (i.e.
 separate "layers" doing separate tasks)

Why? If nested tables can do the work, i won't bother learning how layers
work...

 I don't like to do database connections when I've already output markup,
 what if something goes wrong, or I want to do a redirect, etc?

If something goes wrong - It's the DBA fault. :-)

 I like to access functions in "DB Object" files - those functions return
 results in arrays which I can pass into markup.

 Makes the code a _helluvuh_ lot more maintainable.

I'm pretty comfortable programming directly with OCIwhatever() functions
directly in the main code, that's it.

In other words, i don't need to make my code more maintainable because i'm
comfortable with maintaining it right now.

 True, but why not just bitch at macromedia until they include support for
 PHP in ultradev?

(Well, i haven't purchased dreamweaver either)

 (plegh, visual authoring tools: a necessary evil)

Why, when you have notepad.exe and a couple of browsers to test that the
pages work properly?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] tie string value together

2001-01-15 Thread Iván Sánchez Ortega \MR\

"Brian Clark" ...

 Not quite; you want the concatenation operator:

 $Birthdate = $year . $month . $day; /* assuming day was a typo */

 This will also work:

 $Birthdate = "$year$month$day";

As i know, databases use a 00/00/ date format, so the thing you may do
is

$birthdate = $day . "/" . $month . "/" . $year;
or
$birthdate = "$day/$month/$year";

But you should refer to your database's documentation, i'm not sure it's
always true.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] SMs

2001-01-14 Thread Iván Sánchez Ortega \MR\

""Bastian"" ...
 Hello!

 A requirement is a special server that sends them, but such a server costs
 money, every message costs some.

I read somewhere that you could send SMs if you had your mobile phone linked
to your computer, and special software to needful to make the PC-mobile
interaction...

That way, you could send SMs by your mobile phone... but they should cost as
if you were sending them.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]