Dynamically load pricing from MySQL...

User 2161462 Photo


Registered User
8 posts

Created the form, excepting payments just fine. Wanted to load the pricing from a mysql database to be able to provide that information on the fly.

Everytime I load in the variables it is fine, when submit is entered, it drops out the pricing and throws an error.

"form_field" doesn't have a valid value.

It is dropping the variable when form is submitted.

Any ideas?
User 187934 Photo


Senior Advisor
20,271 posts

Are you using the form script to embed it in your page? If so try dropping the javascript that surrounds it.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2161462 Photo


Registered User
8 posts

First thing I tried actually.

Then I even went into the form direct.

http://example.com/coffee_cup_form/coffee_cup_form.html

and tried to work from there. Upon submit, pushes back to: ../coffee_cup_form.php where the variables are all dropped.
User 187934 Photo


Senior Advisor
20,271 posts

What does you mysql php look like?
I can't get to your form.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2161462 Photo


Registered User
8 posts

<head>
<?php
include_once("class/functions.php");
include_once("login.php");
$data = mysql_query("SELECT * FROM api_featured_event WHERE id='2'") or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
$price = $info['price'];
$team_price = $info['team_price'];
}
?>

/////

<div class="fb-dropdown">
<?php echo "<select id='item31_select_1' data-hint='' name='type_registration'>";

echo "<option id='item31_0_option' selected value='Individual- $ $price'>Individual- $ $price</option>";
echo "<option id='item31_1_option' value='Team- $$team_price'>Team- $$team_price</option>";

echo "</select>";
?>
</div>

Third variation here of the PHP. Started with just allowing the printing the variables for the value's and the display text.

Such as:
Select>
<option value="$price"><?php echo "$price"; ?></option>

http://bluenotebookmedia.com/test/victo … ration.php
User 187934 Photo


Senior Advisor
20,271 posts

I think your setup isn't quite right. Try it this way.:)
Make a php page with all your mysql php on it.
victoria_prices.php
<?php
include_once("class/functions.php");
include_once("login.php");
$data = mysql_query("SELECT * FROM api_featured_event WHERE id='2'") or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
$price = $info['price'];
$team_price = $info['team_price'];
}
echo "<option value='Individual- $ $price'>Individual- $ $price</option>";
echo "<option value='Team- $$team_price'>Team- $$team_price</option>";
?>

Then use an include in your form html
<div class="fb-dropdown">
<select id='item31_select_1' data-hint='' name='type_registration'>
<?php include('../../victoria_prices.php');?>
</select>
</div>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2161462 Photo


Registered User
8 posts

Will try now.
User 2161462 Photo


Registered User
8 posts

Still giving the same error. It's dropping the php no matter what. Even when I just do it straight.

<option value="<?php echo "Individual $100"; ?>">Individual $100</option>

I'll keep playing
User 187934 Photo


Senior Advisor
20,271 posts

Try dropping the value.
<?php
include_once("class/functions.php");
include_once("login.php");
$data = mysql_query("SELECT * FROM api_featured_event WHERE id='2'") or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
$price = $info['price'];
$team_price = $info['team_price'];
}
echo "<option>Individual- $ $price</option>";
echo "<option>Team- $$team_price</option>";
?>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.