Re: [PHP-DB] Need some HELP (not works)

2004-05-10 Thread Marcjon Louwersheimer



- Original message -
From: Adam Farid [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Mon, 10 May 2004 19:54:51 +
Subject: [PHP-DB] Need some HELP (not works)

Thanks pepole.

I've tried but still does not work.

when I put the varaibles name between ' '

I found this error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or 
`T_NUM_STRING'.

I typed in this way

 print INPUT TYPE='hidden' NAME='User_name' 
VALUE='$_POST[UserName]'; 

but nothing  a new.

I have checked  register_globals is on.
in my first page I used session_start(); and   global $HTTP_SESSION_VARS;
I dont know if this cause the problem that I had.

Thanks again and more help please.
Adam

_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger

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


Try using  print INPUT TYPE='hidden' NAME='User_name' 
VALUE='.$_POST[UserName].'; 

Actually, if you're using 4.0.x, you can't use $_POST[UserName]. It was
implemented in 4.1.0.
http://ca.php.net/manual/en/reserved.variables.php#reserved.variables.post
Read about it here.
-- 
  Marcjon

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



Re: [PHP-DB] another strange MYSQL problem

2004-05-08 Thread Marcjon Louwersheimer



- Original message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Sat, 8 May 2004 23:23:05 +0300
Subject: [PHP-DB] another strange MYSQL problem

Hello,

First, I use this, and all is ok:

SELECT * FROM modele WHERE marca='Aprilia' ORDER BY tip ASC.

Then, I use this:

SELECT  * FROM modele WHERE marca='Cagiva' ORDER BY tip ASC

and the records are not ordered ascending by the field tip. In the
first case, the records were ordered. Anyone knows what is wrong?
Thank you!

Best regards,
Marius Panaitescu

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

Well, this might not answer your question (or it might) but you should
not use * in your queries. Specify each column you want to retrieve. This
also might fix you problem, but I'm not sure.
-- 
  Marcjon

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



[PHP-DB] From MySQL to PostgreSQL

2004-05-07 Thread Marcjon Louwersheimer
Hi. I developed a forum using php5 and mysql. Right now I'm hosting it on
my computer, for version for myself and another for a school I volunteer
at. I would like to move the forums to the school's server. Apperently
they don't have MySQL, they have PostgreSQL. I was just wondering, how
much like MySQL is PostgreSQL? Would it be possible to create general
functions (MySQL style) that could also work for PostgreSQL, based on
what a config file set? Right now I have a file that's specific to each
forum, so I could specify PostgreSQL or MySQL and based on that the
function would do the appropriate action. So how much like MySQL is
PostgreSQL?
-- 
  Marcjon

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



Re: [PHP-DB] Session

2004-04-27 Thread Marcjon Louwersheimer
Do you mean a new browser window or a new browser? Like using IE first
and then netscape? If it's the latter, it wont be saved. It generates a
new session ID and wont use the same session as the first browser.
-- 
  Marcjon

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



Re: [PHP-DB] login script

2004-04-26 Thread Marcjon Louwersheimer
This is kind of a big thing. Email me and I'll give you instructions/tips
on making it.


- Original message -
From: andy amol [EMAIL PROTECTED]
To: php php [EMAIL PROTECTED]
Date: Mon, 26 Apr 2004 17:15:27 -0700 (PDT)
Subject: [PHP-DB] login script

hi,
  does anyone have a login script which will take data from the table and
  decide whether the given user is a admin or a normal user.
thanks in advance.
 
Also if there is some help on session variable I would like to know.


-
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs 
-- 
  Marcjon

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



Re: [PHP-DB] How to display table columns

2004-04-25 Thread Marcjon Louwersheimer
Well, you would create a table like this
echo tabletrtdname/tdtdage/tdtdsex/td/tr;
Then, you would do a query (assuming you've already made a connection to
your database)...
$result = mysql_query(SELECT name,age,sex FROM database.usertable);
Then, run through  the results...
while ($row = mysql_fetch_assoc($result))
{ 
  echo
  trtd.$row[name]./tdtd.$row[age]./tdtd.$row[sex]./td/tr;
}
Then, end the table like this
echo /table;
There you have it.

- Original message -
From: andy amol [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Sun, 25 Apr 2004 19:47:37 -0700 (PDT)
Subject: [PHP-DB] How to display table columns

hi,
  I want to display the table coulumns along with those values below it.
  I am only able to display the table values, now I want to diplay the
  corresponding table attribut above the value.
 
eg : name age sex
   abc1m
   xyz 2f
 
I want to display name, age and sex.
 
I am using mysql as database.
 
thanks in advance.
 


-
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25ยข
-- 
  Marcjon

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



Re: [PHP-DB] move_uploaded_file

2004-04-24 Thread Marcjon Louwersheimer
Windows works a bit different. You have to define which folders and files
get access to the internet. After that you can specify the web
permissions using the iis snap in. This is of course if you're using iis.
I'm not sure for apache or other servers handle it.
-- 
  Marcjon

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



Re: [PHP-DB] How to write file store file-name to DB...

2004-04-18 Thread Marcjon Louwersheimer
http://ca2.php.net/manual/en/ref.filesystem.php
Look here for write or fwrite. That should be what you want.
-- 
  Marcjon

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



Re: [PHP-DB] Date SELECT with IF

2004-04-15 Thread Marcjon Louwersheimer
try the WHERE clause.
SELECT name, address, phone, date FROM usertable WHERE date =
'-00-00'
And please, look at the mysql documentation, or at least the tutorial.
-- 
  Marcjon

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



Re: [PHP-DB] include function

2004-04-06 Thread Marcjon Louwersheimer
did you make sure the previous line had a ; at the end? Check that first.


- Original message -
From: Craig Hoffman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Tue, 6 Apr 2004 22:24:27 -0500
Subject: [PHP-DB] include function

Someone tell me why this isn't working? I keep getting a parser error 
on line 36 (the last include).   I'm running PHP 4.3.5 if that helps.

include (include/dbadmin.php);
include (jpgraph/src/jpgraph.php);   
include (jpgraph/src/jpgraph_bar.php);

Parse error: parse error, unexpected T_INCLUDE in 
/Users/choffman/Sites/www/cyclistsedge/top_performace.php on line 36

__
Craig Hoffman - eClimb Media

v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
  Marcjon

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



[PHP-DB] Impact of MySQL Queries

2004-03-12 Thread Marcjon Louwersheimer
I'm working on a forum. When
it displays a forum index, it gets all the topics and depending on the
offset, displays only ten at a time. Now that's a single query. But
problem comes when I display how many replies each post has. So far, when
it does the while loop, it does a query for each item. Here's the code:

$indexresult = mysql_query(SELECT
uid,userpost,datetime,body,head,editdatetime,edituserpost,
sticky,room,locked,lastpostdate,lastpostuser FROM orinsbox.forumposts
WHERE ROOM = '.$_GET['room'].' AND .filter($filter). 
ORDER BY .sortby($sortby).)


$while_offset = 0; // This is the counter used to check what post the 
while loop is on
$while_count = 1;  // This is how many posts have been displayed (once 
it has reached the offset)
// Print out posts
while ($row = mysql_fetch_assoc($indexresult)) // Run through all the posts
{   
$while_offset++;
if ($while_offset  $offset AND $while_count = 10){ // if the 
post is in the range
$while_count++;
// Get num of replies
$repliesresult = mysql_query(SELECT
uid FROM orinsbox.forumposts
WHERE common = '.$row[uid].')
  or die (Unable to run query, YOU SUCK: .mysql_error());
$replies = mysql_num_rows($repliesresult);

// This is setting the image to be used for the post
if($row[locked] != NULL AND $row[sticky] != NULL 
){$icon = img src=\images/gold_lock.gif\ width=\18\ height=\24\ title=\Locked 
and Sticky\;}
elseif($row[locked] != NULL AND $row[sticky] == NULL 
){$icon = img src=\images/silver_lock.gif\ width=\18\ height=\24\ 
title=\Locked\;}
elseif($row[locked] == NULL AND $row[sticky] != NULL 
){$icon = img src=\images/gold_nugget.gif\ width=\18\ height=\24\ 
title=\Sticky\;}
else {$icon = NULL;}
// $row[descrip]

if (!isset($bgcolour) OR $bgcolour == FF){$bgcolour = 
EE;}else{$bgcolour = FF;} // For alternating backround colours of the cells
if (!isset($row[common]) OR $row[common] == NULL){
echo tr bgcolor=\#.$bgcolour.\ height=24;
echo td width=\18\.$icon./td
tda 
href=forums.php?room=.urlencode($_GET['room']).doForums=viewtopicobject=.$row[uid].offset=.$offset..$row[head]./a/td

td.ucwords($row[userpost])./tdtd.$replies./td
tdOn .$row[lastpostdate];
if ($row[lastpostuser] != NULL){  by 
.$row[lastpostuser];}
echo /td;
echo /tr;}

} else {// Don't post it
}

}

The 'uid' column is the unique number of the post. All posts have this.
Now the column called 'common' is for replies. Posts that are to appear
in the forum index don't have a 'common' set.
If it is a reply, the column 'common' is set to the uid of the post it is
a reply too.
Example: Post 1:
Subject: Hey all how do I do this UID: marforu200401F COMMON: NULL
Post 2:
Subject: Hey this is how you do it! UID: jayforu200404A COMMON:
marforu200401F

Is there an easier way to do this, maybe with a sub select statement
maybe? I only know basic mysql. I hope this is understandable...
Oh yeah, you might wonder why I use the custom offset instead of using
the LIMIT and OFFSET clauses in the main MySQL query. The problem with
this is
that when I order the posts, it would only order them by the one gotten,
not them all, which is what I wanted. 
-- 
  Marcjon

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



[PHP-DB] Impact of MySQL Queries

2004-03-11 Thread Marcjon Louwersheimer
I have IIS 4.x and MySQL running on the same machine. So do queries use
up bandwidth? Does it matter if I have 20 queries per page? Will that
slow it down if many people started using my site? Currently only I, and
some friends for testing, use it.
-- 
  Marcjon

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



Re: [PHP-DB] win32 Timestamp problem

2004-03-09 Thread Marcjon Louwersheimer
Not sure if this'll help you, but I like to store my dates/times using
this format: date(Y-m-d H:i:s) It's always a 19 character string, so
you could use the substr function to get different parts of the date.
substr(date(Y-m-d H:i:s),0,4) would get the year, for example. Hope
this helps.
-- 
  Marcjon

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



[PHP-DB] Forum Script

2004-03-07 Thread Marcjon Louwersheimer
Hello friends.

I am currently trying to develop a forum system. All is going well, but I
was wondering if there woud be a way to do something that I'm already
doing that might be more efficient. First I'll give you some
background...
I am using php 4 and mysql 4.
I have a database setup, and I have a table set up for forum posts. I
have fields for which board it was posted on and which (if any) post it
was a reply to. If it wasn't a reply, that field will be left blank. For
these fields, I use a unique ID system, which makes an ID based on the
poster and when it was posted.
Now when I display them, I make a table for the subject (head), author,
last post, number of replies etc. I make it do a SELECT query and it gets
the results and displays them. Now the problem I come into is with the
number of replies.
Currently while it's doing the WHILE loop, it performs another query for
each post, checking how many posts have there reply field set to the
post's current ID. That works fine, but it means I'm doing (up to) 21
queries per page, which I would guess is alot. I was wondering if there
would be a way I could get the number of replies as a column in my first
query (where I get the forum posts). Or maybe there's a more effective
way by getting the number of replies first. I don't really want to store
the number of replies in the database, if I can.
If I'm not being clear or I'm not using proper netiquette, I appologize,
I'm new to this (mailing lists). Any help would be appreciated!
-- 
  Marcjon

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