473,471 Members | 4,637 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

creating variables

4 New Member
I have the following problem, i have the price variable $kolona
which is taking infromation from the databse on the following conditioinis.

if ($days<3)
{
$kolona='price';
}
elseif ($days > 2 && $days < 5)
{
$kolona='price34';
}
else
{
$kolona='price57';
}

i have trid to make a varibla in order to put it in the hidden field so i can mail afterwards,

$total=$row[$kolona];

hidden field

<input type="hidden" name="EURI" value="<? echo $total;?>">

i use stripslahses to get it to mail

. " " . stripslashes($EURI)
The problem is that I get all thre info in the mail exept the one $kolona viarable value, can you tell me which way should I create the variable since this seems not to work.
Jul 31 '07 #1
3 1277
r035198x
13,262 MVP
I have the following problem, i have the price variable $kolona
which is taking infromation from the databse on the following conditioinis.

if ($days<3)
{
$kolona='price';
}
elseif ($days > 2 && $days < 5)
{
$kolona='price34';
}
else
{
$kolona='price57';
}

i have trid to make a varibla in order to put it in the hidden field so i can mail afterwards,

$total=$row[$kolona];

hidden field

<input type="hidden" name="EURI" value="<? echo $total;?>">

i use stripslahses to get it to mail

. " " . stripslashes($EURI)
The problem is that I get all thre info in the mail exept the one $kolona viarable value, can you tell me which way should I create the variable since this seems not to work.
This is more a PHP question than it is a mysql one, so I'll move this to the PHP Forum.
Jul 31 '07 #2
kovik
1,044 Recognized Expert Top Contributor
The problem is that I get all thre info in the mail exept the one $kolona viarable value, can you tell me which way should I create the variable since this seems not to work.
You aren't making any sense. Instead of generalizing, try telling us what you're trying to do.
Aug 1 '07 #3
nathj
938 Recognized Expert Contributor
If I understand you correctly you could try using a switch case statement.

[php]
<?php

switch ($days)
{
case 1: case 2: // less than 3
$kolona = 'price';
break;
case 3: case 4: // greater than 2 and less than 5
$kolona ='price34';
default: // the rest
$kolona='price57';
}

?>
[/php]

Is this what you are after?

Cheers
nathj
Aug 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: Tom Moroow | last post by:
Hi, I'm pretty new to javascript and was wondering how you would piece together a variable name and then assign it a value. I want to create a hidden field and assign it a value based on the value...
1
by: CES | last post by:
All, I was wondering if someone could point me to a tutorial on creating & accessing functions from within a wrapper function. I've created a group of functions related to a timer event. All...
1
by: BradenM - Sonoma Computer | last post by:
Hello; I am creating a script that will be taking data from a POST and submitting the data to variables which are placed within a hash for string to data association. Then, using HTML::Table and...
1
by: locus | last post by:
I am trying to create a string with the values of some variables as follows const char *quer = "insert into comm_records (caller_id,userID,c_area,c_duration,c_date) values...
17
Motoma
by: Motoma | last post by:
This article is cross posted from my personal blog. You can find the original article, in all its splendor, at http://motomastyle.com/creating-a-mysql-data-abstraction-layer-in-php/. Introduction:...
6
by: Chris Carlen | last post by:
Hi: I have an embedded system, platform: TI TMS320F2812 32-bit integer DSP. A module (.c file) contains external (to the funcs in that module) variables which are used to affect the operation...
5
by: Aryan | last post by:
Hi, I am using C# with framework 2.0 and creating PDF files on-fly, along with this I am using Windows 2003 Server. I am using Byte to take the data input and then save into pdf format on...
6
by: Helmut Giese | last post by:
Hello out there, I am new to JS so please bear with me. I am tasked to investigate, whether it is feasible to port one of our applications from Tcl to JS - the idea being to write a program to...
14
by: chromis | last post by:
Hi, I've been trying to implement a more OOP oriented approach to dealing with user security on one of my websites, and I am trying to validate the user against an array of roles, however I am...
14
by: tdahsu | last post by:
I have twenty-five checkboxes I need to create (don't ask): self.checkbox1 = ... self.checkbox2 = ... .. .. .. self.checkbox25 = ... Right now, my code has 25 lines in it, one for each...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.