Re: [PHP] PHP Syntax Help - Check?

2010-02-24 Thread Rick Dwyer

Hmm.  OK with the help below, I am closer.

The other fields on the page are getting passed via form fields that  
look like this:


input  type="text" value=""  
name="form[element9]" size="40" maxlength="255"

so I added:
input  type="text" value=""  
name="form[my_id]" size="40" maxlength="255"



and formcheck.php has:

 "field_label")
$form_fields = array(
"element0" => 'Your Name:',
"element1" => 'Your Email:',
"element4" => 'Item Number:',
.
);
and I added:
"my_id" => 'My ID Is:',

And this works!
So when I am on mypage.php and I enter a value into the form field  
"my_id" it carries over and repopulates should the form fail validation.


But upon initial load of the page from my link of mypage.php?my_id=5  
(so I am not getting there via a form submit) how do I get the value  
into the form field?



 --Rick


On Feb 25, 2010, at 1:02 AM, viraj wrote:


if you do the redirection with header('Location: /mypage.php'),
setting a variable on formcheck.php is not enough.

if you modify the header('Location: /mypage.php') to..

header('Location: /mypage.php?my_id=5')

it will take the variable to mypage.php as $_GET['my_id]

you can not expect a variable value set in to $_POST array to reflect
on a totally different page without making it a form post (aka use of
proper headers).

i guess, it's time to you to read about session_start() method and the
array $_SESSION available in php :)


~viraj

On Thu, Feb 25, 2010 at 11:22 AM, Rick Dwyer   
wrote:
OK... external function... that would explain why I could not  
locate it.


Let me get right to the problem I am having with this code as  
someone may be

able to help directly.

I have a link on a page that opens a contact form.  The link is
mypage.php?my_id=5

So on mypage.php, I capture this value with:
$my_id=$_GET['my_id'];

I understand this much.  But when the end user submits this contact  
form
they do so to formcheck.php and if formcheck.php sees a required  
field is
blank, it throws it back to mypage.php with an alert.  BUT, I lose  
the value
of the variable $my_id.  SO, I created a hidden field on mypate.php  
with

 value="" and on formcheck.php, I added $my_id =
$_Post['my_id'];

However, when formcheck.php returns me to mypage.php, $my_id is  
still blank.


Very frustrating.

Any help determining what I am doing wrong is greatly appreciated.

Thanks.



 --Rick


On Feb 25, 2010, at 12:31 AM, Paul M Foster wrote:


On Thu, Feb 25, 2010 at 12:16:08AM -0500, Robert Cummings wrote:


Rick Dwyer wrote:


Hello all.

I'm trying to learn PHP on the fly and I have a line of code that
contains syntax I can't find documented anywhere:

php echo check('element8');

In the above line, can someone tell me what "check" means?



In the above, check is a function. It is being called with  
parameter

'element8'.


This is true. But perhaps more importantly, check() is not a  
native PHP

function. Thus it comes from some other library or group of external
functions.

Paul

--
Paul M. Foster

--
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






--
~viraj

--
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] PHP Syntax Help - Check?

2010-02-24 Thread James McLean
On Thu, Feb 25, 2010 at 4:22 PM, Rick Dwyer  wrote:
> OK... external function... that would explain why I could not locate it.
>
> Let me get right to the problem I am having with this code as someone may be
> able to help directly.
>
> I have a link on a page that opens a contact form.  The link is
> mypage.php?my_id=5
>
> So on mypage.php, I capture this value with:
> $my_id=$_GET['my_id'];
>
> I understand this much.  But when the end user submits this contact form
> they do so to formcheck.php and if formcheck.php sees a required field is
> blank, it throws it back to mypage.php with an alert.  BUT, I lose the value
> of the variable $my_id.  SO, I created a hidden field on mypate.php with
>  value="" and on formcheck.php, I added $my_id =
> $_Post['my_id'];
>
> However, when formcheck.php returns me to mypage.php, $my_id is still blank.

Use the right varialble for the method you're using, so if you're
posting, use $_POST, if you're getting use $_GET..

Going by your example, $_GET is what you should probably be using,
this is usually the default method if no method is specified on the
form tag.

Cheers

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



Re: [PHP] PHP Syntax Help - Check?

2010-02-24 Thread viraj
if you do the redirection with header('Location: /mypage.php'),
setting a variable on formcheck.php is not enough.

if you modify the header('Location: /mypage.php') to..

header('Location: /mypage.php?my_id=5')

it will take the variable to mypage.php as $_GET['my_id]

you can not expect a variable value set in to $_POST array to reflect
on a totally different page without making it a form post (aka use of
proper headers).

i guess, it's time to you to read about session_start() method and the
array $_SESSION available in php :)


~viraj

On Thu, Feb 25, 2010 at 11:22 AM, Rick Dwyer  wrote:
> OK... external function... that would explain why I could not locate it.
>
> Let me get right to the problem I am having with this code as someone may be
> able to help directly.
>
> I have a link on a page that opens a contact form.  The link is
> mypage.php?my_id=5
>
> So on mypage.php, I capture this value with:
> $my_id=$_GET['my_id'];
>
> I understand this much.  But when the end user submits this contact form
> they do so to formcheck.php and if formcheck.php sees a required field is
> blank, it throws it back to mypage.php with an alert.  BUT, I lose the value
> of the variable $my_id.  SO, I created a hidden field on mypate.php with
>  value="" and on formcheck.php, I added $my_id =
> $_Post['my_id'];
>
> However, when formcheck.php returns me to mypage.php, $my_id is still blank.
>
> Very frustrating.
>
> Any help determining what I am doing wrong is greatly appreciated.
>
> Thanks.
>
>
>
>  --Rick
>
>
> On Feb 25, 2010, at 12:31 AM, Paul M Foster wrote:
>
>> On Thu, Feb 25, 2010 at 12:16:08AM -0500, Robert Cummings wrote:
>>
>>> Rick Dwyer wrote:

 Hello all.

 I'm trying to learn PHP on the fly and I have a line of code that
 contains syntax I can't find documented anywhere:

 php echo check('element8');

 In the above line, can someone tell me what "check" means?
>>>
>>>
>>> In the above, check is a function. It is being called with parameter
>>> 'element8'.
>>
>> This is true. But perhaps more importantly, check() is not a native PHP
>> function. Thus it comes from some other library or group of external
>> functions.
>>
>> Paul
>>
>> --
>> Paul M. Foster
>>
>> --
>> 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
>
>



-- 
~viraj

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



Re: [PHP] PHP Syntax Help - Check?

2010-02-24 Thread Rick Dwyer

OK... external function... that would explain why I could not locate it.

Let me get right to the problem I am having with this code as someone  
may be able to help directly.


I have a link on a page that opens a contact form.  The link is  
mypage.php?my_id=5


So on mypage.php, I capture this value with:
$my_id=$_GET['my_id'];

I understand this much.  But when the end user submits this contact  
form they do so to formcheck.php and if formcheck.php sees a required  
field is blank, it throws it back to mypage.php with an alert.  BUT, I  
lose the value of the variable $my_id.  SO, I created a hidden field  
on mypate.php with  value="" and on  
formcheck.php, I added $my_id = $_Post['my_id'];


However, when formcheck.php returns me to mypage.php, $my_id is still  
blank.


Very frustrating.

Any help determining what I am doing wrong is greatly appreciated.

Thanks.



 --Rick


On Feb 25, 2010, at 12:31 AM, Paul M Foster wrote:


On Thu, Feb 25, 2010 at 12:16:08AM -0500, Robert Cummings wrote:


Rick Dwyer wrote:

Hello all.

I'm trying to learn PHP on the fly and I have a line of code that
contains syntax I can't find documented anywhere:

php echo check('element8');

In the above line, can someone tell me what "check" means?



In the above, check is a function. It is being called with parameter
'element8'.


This is true. But perhaps more importantly, check() is not a native  
PHP

function. Thus it comes from some other library or group of external
functions.

Paul

--
Paul M. Foster

--
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] PHP Syntax Help - Check?

2010-02-24 Thread Paul M Foster
On Thu, Feb 25, 2010 at 12:16:08AM -0500, Robert Cummings wrote:

> Rick Dwyer wrote:
>> Hello all.
>>
>> I'm trying to learn PHP on the fly and I have a line of code that
>> contains syntax I can't find documented anywhere:
>>
>> php echo check('element8');
>>
>> In the above line, can someone tell me what "check" means?
>
>
> In the above, check is a function. It is being called with parameter
> 'element8'.

This is true. But perhaps more importantly, check() is not a native PHP
function. Thus it comes from some other library or group of external
functions.

Paul

-- 
Paul M. Foster

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



Re: [PHP] PHP Syntax Help - Check?

2010-02-24 Thread Robert Cummings

Rick Dwyer wrote:

Hello all.

I'm trying to learn PHP on the fly and I have a line of code that  
contains syntax I can't find documented anywhere:


php echo check('element8');

In the above line, can someone tell me what "check" means?



In the above, check is a function. It is being called with parameter 
'element8'.


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



[PHP] PHP Syntax Help - Check?

2010-02-24 Thread Rick Dwyer

Hello all.

I'm trying to learn PHP on the fly and I have a line of code that  
contains syntax I can't find documented anywhere:


php echo check('element8');

In the above line, can someone tell me what "check" means?

Thank you.

 --Rick



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



Re: [PHP] Syntax Help, Please

2004-06-15 Thread Robin Vickery
On Tue, 15 Jun 2004 13:20:24 -0400, Steve Douville <[EMAIL PROTECTED]> wrote:
> 
> I've forgotten how to assign something like this...
> 
> $someStr = EOF>>>"
>   bunch of raw non-echo'd html
> "
> EOF>>>;
> 
> But can't seem to get the right syntax. Tried looking in the manual, but
> don't even know what I'm looking for!



Here they are in the manual:

http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

  -robin

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



Re: [PHP] Syntax Help, Please

2004-06-15 Thread janet

 
In a message dated 6/15/2004 10:20:59 AM Pacific Daylight Time,
[EMAIL PROTECTED] writes:

>I've forgotten how to assign something like this...
>
>$someStr = EOF>>>"
>  bunch of raw non-echo'd html
>"
>EOF>>>;
>
>But can't seem to get the right syntax. Tried looking in the manual, but
>don't even know what I'm looking for!

This way of entering text is called a heredoc. The syntax goes like this:

$varname = <

RE: [PHP] Syntax Help, Please

2004-06-15 Thread Rick Fletcher
> I've forgotten how to assign something like this...
> 
> $someStr = EOF>>>"
>   bunch of raw non-echo'd html
> "
> EOF>>>;
> 
> But can't seem to get the right syntax. Tried looking in the 
> manual, but
> don't even know what I'm looking for!

You're looking for a "heredoc."

http://www.php.net/manual/en/language.types.string.php#language.types.string
.syntax.heredoc

Cheers,

Rick

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



[PHP] Syntax Help, Please

2004-06-15 Thread Steve Douville
I've forgotten how to assign something like this...

$someStr = EOF>>>"
  bunch of raw non-echo'd html
"
EOF>>>;

But can't seem to get the right syntax. Tried looking in the manual, but
don't even know what I'm looking for!

TIA,
Steve


Re: [PHP] syntax help

2004-02-13 Thread Richard Davey
Hello bob,

Friday, February 13, 2004, 12:10:06 PM, you wrote:

bp> $array=array("Flyer","Email","Phone");
bp> $array_len=count($array);
bp> for($i=0;$i<$array_len;$i++){
bp>   $query="select count(score) from test_table
bp> where source = '$array[$i]'";
bp>   $result=mssql_query($query,$numero);
bp>   $row=mssql_fetch_row($result);
bp>   $array[$i].total=$row[0];<-- problem here
bp> }

$array[$i]['total'] = $row[0];

Alternatively, you can probably do this too:

$query = "SELECT COUNT(score) AS hits FROM ...";
$result = mssql_query($query, $numero);
$array[$i]['total'] = mssql_result($result, 0, "hits");

Same end result, but saves on processing a bit. This assumes MSSql has
the same functions available as MySQL does (the mssql_result part)

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



[PHP] syntax help

2004-02-13 Thread bob pilly
Hi all

I have a problem that is probably just a lack of php
syntax knowledge on my part and hopefully someone can
help me out.

I have an array and i want to query a database for
each value in that array. I then want to store that
result as a new variable called $array[value]total. 

see code below

$array=array("Flyer","Email","Phone");
$array_len=count($array);
for($i=0;$i<$array_len;$i++){
  $query="select count(score) from test_table
where source = '$array[$i]'";
  $result=mssql_query($query,$numero);
  $row=mssql_fetch_row($result);
  $array[$i].total=$row[0];<-- problem here
}


so for the above code i would like to create three
variable $flyertotal,$emailtotal & $phonetotal and
have the result of the count(score) query stored in
them. Any help or pointing to documentation would be
greatly appreciated!

Cheers

Bob


Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

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



Re: [PHP] Syntax Help

2002-11-14 Thread conbud
Jason thanks,
I completely forgot about trying echo $sql by using that I found where it
was messing up. Thanks again.

Lee

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:200211141725.47510.php-general@;gremlins.biz...
> On Thursday 14 November 2002 17:22, conbud wrote:
> > Whats wrong here ?? The variables are getting the correct information
from
> > the form but for some reason as soon as I put the variables into the
$sql
> > they dont post the proper data to the database, its connecting to the
> > database ok but just not updating the data.
> >
> > $sql = "UPDATE updates SET member= '{$_POST['mem']}', email=
> > '{$_POST['email']}', position= '{$_POST['pos']}', dateadded=
> > '{$_POST['dateadded']}', descp= '{$_POST['descp']}', message=
> > '{$_POST['message']}' where id= '{$_POST['id']}'";
> >
> > $result = mysql_query($sql);
>
> Does echo($sql) look OK?
>
> How about echo mysql_error()? Or executing $sql in the mysql command line
> interface?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> SANTA CLAUS comes down a FIRE ESCAPE wearing bright blue LEG WARMERS
> ... He scrubs the POPE with a mild soap or detergent for 15 minutes,
> starring JANE FONDA!!
> */
>



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




Re: [PHP] Syntax Help

2002-11-14 Thread Petre Agenbag
What do you mean by "dont post proper data"?

Have you added slashes to the variables?
(use addslashes() and then stripslashes() when reading the contents from
the db)
On Thu, 2002-11-14 at 11:22, conbud wrote:
> Whats wrong here ?? The variables are getting the correct information from
> the form but for some reason as soon as I put the variables into the $sql
> they dont post the proper data to the database, its connecting to the
> database ok but just not updating the data.
> 
> $sql = "UPDATE updates SET member= '{$_POST['mem']}', email=
> '{$_POST['email']}', position= '{$_POST['pos']}', dateadded=
> '{$_POST['dateadded']}', descp= '{$_POST['descp']}', message=
> '{$_POST['message']}' where id= '{$_POST['id']}'";
> 
> $result = mysql_query($sql);
> 
> Lee
> 
> 
> 
> -- 
> 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] Syntax Help

2002-11-14 Thread Jason Wong
On Thursday 14 November 2002 17:22, conbud wrote:
> Whats wrong here ?? The variables are getting the correct information from
> the form but for some reason as soon as I put the variables into the $sql
> they dont post the proper data to the database, its connecting to the
> database ok but just not updating the data.
>
> $sql = "UPDATE updates SET member= '{$_POST['mem']}', email=
> '{$_POST['email']}', position= '{$_POST['pos']}', dateadded=
> '{$_POST['dateadded']}', descp= '{$_POST['descp']}', message=
> '{$_POST['message']}' where id= '{$_POST['id']}'";
>
> $result = mysql_query($sql);

Does echo($sql) look OK? 

How about echo mysql_error()? Or executing $sql in the mysql command line 
interface?

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

/*
SANTA CLAUS comes down a FIRE ESCAPE wearing bright blue LEG WARMERS
... He scrubs the POPE with a mild soap or detergent for 15 minutes,
starring JANE FONDA!!
*/


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




[PHP] Syntax Help

2002-11-14 Thread conbud
Whats wrong here ?? The variables are getting the correct information from
the form but for some reason as soon as I put the variables into the $sql
they dont post the proper data to the database, its connecting to the
database ok but just not updating the data.

$sql = "UPDATE updates SET member= '{$_POST['mem']}', email=
'{$_POST['email']}', position= '{$_POST['pos']}', dateadded=
'{$_POST['dateadded']}', descp= '{$_POST['descp']}', message=
'{$_POST['message']}' where id= '{$_POST['id']}'";

$result = mysql_query($sql);

Lee



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




Re: [PHP] syntax help please?

2001-08-29 Thread David Robley

On Thu, 30 Aug 2001 00:15, Glyndower wrote:
> I'm coming over from the ASP side and I'm trying to get a handle on
> this stuff, I could use a little help with the how and wheres, please.
> I do ok with the SQl bits, but the PHP bits are still being elusive...
>
> Heres my code:
>
> $sql = "SELECT
> listnum,agentname,listAgent,streetName,streetNum,curprice,email_addr,of
>ficen
> ame,officephone,agentname,agentphone,bedrooms,full_baths,half_baths,cus
>tomer Remarks FROM mlsdb WHERE mlsdb.statusCode = 'A' AND mlsdb.catgNum
> = '1'";
>
> $result = mysql_query($sql);
>
> //load it all into the associative array
>
> while(list($listnum,$agentname,$streetName,$streetNum) =
> mysql_fetch_row($result)):
>   echo "$listnum $agentname $streetNum $streetName ";
> endwhile;
>
>  ?>
>
> Which displays:
>
> 50730 Aubrey May Wyndwood Drive 0
> 873171 Tia Lingle Palm Trl 9903
> 902385 Anthony Kipen Normandy Blvd 6458 ...
>
> As you can see the $streetNum displays BEFORE the $streetName, I'm
> assuming thats becuase thats the order they are in in the query..(?)
>
> Heres my  "I'm a newbie" question... exactly how and where do I define
> the variables so that i can use them in a different order than they are
> in the query?

Use extract ,which makes available variables of the same name as the 
fields in your table.

$result = mysql_query($sql);
while($row = mysql_fetch_array($result)) {
  extract($row);
  echo "$listnum $agentname $streetNum $streetName ";
}

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Oxymoron: Weather Forecast.

-- 
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] syntax help please?

2001-08-29 Thread Alexander Deruwe

On Wednesday 29 August 2001 14:45, Glyndower wrote:

> Heres my  "I'm a newbie" question... exactly how and where do I define the
> variables so that i can use them in a different order than they are in the
> query?

Go over your results like this instead:

while ($row = mysql_fetch_row($result)) {
echo $row['listnum']; // displays 'listnum' field
echo $row['officephone']; // etc...
}

(I've assumed your syntax for the mysql_fetch_row() function, I haven't used 
it in a while (use PostgreSQL myself)).

ad

-- 
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]




[PHP] syntax help please?

2001-08-29 Thread Glyndower

I'm coming over from the ASP side and I'm trying to get a handle on this
stuff, I could use a little help with the how and wheres, please. I do ok
with the SQl bits, but the PHP bits are still being elusive...

Heres my code:

$sql = "SELECT
listnum,agentname,listAgent,streetName,streetNum,curprice,email_addr,officen
ame,officephone,agentname,agentphone,bedrooms,full_baths,half_baths,customer
Remarks FROM mlsdb WHERE mlsdb.statusCode = 'A' AND mlsdb.catgNum = '1'";

$result = mysql_query($sql);

//load it all into the associative array

while(list($listnum,$agentname,$streetName,$streetNum) =
mysql_fetch_row($result)):
echo "$listnum $agentname $streetNum $streetName ";
endwhile;

 ?>

Which displays:

50730 Aubrey May Wyndwood Drive 0
873171 Tia Lingle Palm Trl 9903
902385 Anthony Kipen Normandy Blvd 6458 ...

As you can see the $streetNum displays BEFORE the $streetName, I'm assuming
thats becuase thats the order they are in in the query..(?)

Heres my  "I'm a newbie" question... exactly how and where do I define the
variables so that i can use them in a different order than they are in the
query?


-- 
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] syntax help~~~

2001-08-05 Thread Coconut Ming

Hi..
   It is not workable too... thanks.

"Andreas D. Landmark" wrote:

> At 05.08.2001 12:49, Coconut Ming wrote:
> >Hi
> >   I am having the problem in the coding below
> >
> > >
> >mysql_connect('localhost','123','123') or die ("Unable to connect to SQL
> >Server");
> >mysql_select_db('Helpwatch') or die ("Unable to select database");
> >
> >$temp = $username."watch";
> >$watchlist_query = mysql_query("Create Table "$temp"(WId int Not Null
> >auto_increment, QId int not null, Primary Key (WId));");
> >?>
> >
> >but I can't do that.. Because of the syntax error, the coding I have
> >underline is where the parser told me that is an error there.
> >I have playing around with it for 2 hours and more... but I cant solve
> >it.. Anyway help is greatly appreciated.
> >Thanks in advance.
>
> Your underlining doesn't show verywell in plain text, but anyhow, your
> line $watchlist_query ... is missing to .'s...
>
> Create Table "$temp", should be Create Table " . $temp . ", that way you'll
> concatenate the string in the way you want them to (and the code should work).
>
> --
> Andreas D Landmark / noXtension
> Real Time, adj.:
>  Here and now, as opposed to fake time, which only occurs there
> and then.


-- 
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] syntax help~~~

2001-08-05 Thread Andreas D. Landmark

At 05.08.2001 12:49, Coconut Ming wrote:
>Hi
>   I am having the problem in the coding below
>
>
>mysql_connect('localhost','123','123') or die ("Unable to connect to SQL
>Server");
>mysql_select_db('Helpwatch') or die ("Unable to select database");
>
>$temp = $username."watch";
>$watchlist_query = mysql_query("Create Table "$temp"(WId int Not Null
>auto_increment, QId int not null, Primary Key (WId));");
>?>
>
>but I can't do that.. Because of the syntax error, the coding I have
>underline is where the parser told me that is an error there.
>I have playing around with it for 2 hours and more... but I cant solve
>it.. Anyway help is greatly appreciated.
>Thanks in advance.

Your underlining doesn't show verywell in plain text, but anyhow, your
line $watchlist_query ... is missing to .'s...

Create Table "$temp", should be Create Table " . $temp . ", that way you'll
concatenate the string in the way you want them to (and the code should work).



-- 
Andreas D Landmark / noXtension
Real Time, adj.:
 Here and now, as opposed to fake time, which only occurs there
and then.


-- 
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]




[PHP] syntax help~~~

2001-08-05 Thread Coconut Ming

Hi
  I am having the problem in the coding below



So.. in the above coding. I need to create a table. The table name
should be a user-define name + "watch"
I acquire the $username correctly and the variable $temp is working fine
when I try to echo the value of it.
Just say. I enter my username as coconut so I wish the mysql query to
create a table called coconutwatch
but I can't do that.. Because of the syntax error, the coding I have
underline is where the parser told me that is an error there.
I have playing around with it for 2 hours and more... but I cant solve
it.. Anyway help is greatly appreciated.
Thanks in advance.

Sincerely
Kok Ming