PHP Question
What is the php mysql coding so that I can retrieve an item from one column in the database, not the whole row, just one column. Have created a CMS and want to add coding to site design per page. Will use a div class technique as client wants a scroller.
http://www.urhomefsbo.com/CMS_training/admin/list_art.php - you can add other page information in the CMS by clicking edit, etc.
Then I would like the ability to add to each page, but one item per column. Want the ability to add coding to designed site, so client can update site page content only.
http://www.urhomefsbo.com/CMS_training/template.php
Tracey
No, Here is the coding:
<br />
<br />?php require_once('../Connections/connCMS.php'); ?>
<br />
<br />
<br />
<br />//Create a Database connection
<br />
<br /><?php<br /> $connection = mysql_connect("" , "" , "Homefsbo123");<br /> if (!$connection){<br /> die ("Database connection failed: ". mysql_error());<br /> } <br />?>
<br />
<br />//Select a Database to use
<br />
<br /><?php<br /> $db_select = mysql_select_db("tracey123", $connCMS);<br /> if (!$db_select){<br /> die ("Database selection failed: ". mysql_error());<br /> } <br />?>
<br />
<br />//Get Item from Database
<br />
<br /><?php <br /> $result = mysql_query("SELECT * FROM page_pag", $connCMS); <br /> if (!$result){<br /> die("Database query failed: ". mysql_error());<br /> } <br />?>
<br />
<br />//Use returned data.
<br />
<br /><?php<br /> while($col = mysql_fetch_array($result)) {<br /> echo "<p>" , $col[1];<br />}<br /><br />mysql_free_result($result);<br />mysql_close();<br />?>
<br />
<br />
<br />
<br />//Close connection.
<br />
<br /><?php<br /> mysql_close($connection);<br />?>
<br />
<br />Would like to just get the column information to be placed on a page by adding a php code to each page in the website. Don't want to display the whole row. I created the CMS using ADDT, but now need it to work with the web site. Want to add a code to each page. Client would go online and update the record in the list_art.php page adding new content to each column or updating, etc....... I hope this is clear, this is my first php/mysql program?
<br />
<br />tracey
<br />
<br />tw
Similar Messages
-
PHP question related to preg_match_all since PHP 5.4 [SOLVED]
Please let me know if a PHP syntax related question is not appropiate here. I am debugging an abandoned PHP 5.2.3 script from: http://outbreakmonkey.org/mythtv/csr0.3.php
This is the part of the code with the problem. I believe preg_match_all has an issue with PHP 5.6.
$cutlist=file("$recordingdir/$txtfile");
#Markssql will hold the lines of SQL to insert in to the DB.
$marks=array();
#Go through each line
foreach ($cutlist as $aline) {
#And match "One or more digit followed by one or more space/tab folowed by one or more digits again"
#ie. Look for two columns of numbers - get those numbers.
preg_match_all('/^([0-9]+)\s+([0-9]+)/',$aline,$result);
#if there numbers make sense, create some SQL to insert the record in to the database
if(!empty($result[1])) {
if (($result[1][0]>0)&&($result[2][0])>1) {
$marks[$result[1][0]]=MARK_COMM_START;
$marks[$result[2][0]]=MARK_COMM_END;
return($marks);
with a sample $cutlist being:
FILE PROCESSING COMPLETE 99042 FRAMES AT 2500
27475 32467
52725 58360
86124 89494
96382 99042
The script works with PHP 5.6 but returns an output of 0 for these marks. PHP says the following in the change log:
Changelog
Version Description
5.4.0 The matches parameter became optional.
5.3.6 Returns FALSE if offset is higher than subject length.
5.2.2 Named subpatterns now accept the syntax (?<name>) and (?'name') as well as (?P<name>). Previous versions accepted only (?P<name>).
Does anyone good with PHP know how the syntax of preg_match_all could be changed to work with 5.6? Or maybe another function to do the same?
Thanks.
Last edited by wdirksen (2014-10-02 19:33:55)Thanks mpan for your reply.
This is not a matter of strict debugging per se. This PHP script has worked for many in the past. Also the provided cutlist is a complete one and not a snippit. There is more online about preg_match_all and PHP regressions so I was hoping someone whould know an easy way out here. I don't think it has to do with foreach. I will try to track this down and learn from it, starting with trying an older PHP version with current ARCH and hoping it will not fyrk up other PHP stuff like mythweb.
Yeah. You're right about the Programming and Scripting. I didn't scroll down far enough I guess. -
Database setup with MySQL and PHP question
Hello all,
I recently had a problem getting a report to work for a site I was updating. This site is written in PHP with a MySQL database. The application is to track customer calls to auto repair stores. The database has a lot of foreign keys because they wanted to update information in only one spot and have multiple records be updated all at once. So, I've got all the information from individual calls saved in the call_log table, and have foreign keys to reference information in other tables (for example this table lists what store received the call referencing the store table). If a store changes locations, they want to have reports automatically update with the new address, connection to conversation number, etc.
In one of the responses to my question on how to get this report to work, I was told that this could be done without using foreign keys (by Normalizing the database using mapping tables). I am still a newbie to MySQL, and after looking though a lot of manuals, tutorials, and forum posts, I am more confused now than ever.
I got the report to work using the foreign keys, but I would like to learn what I should have done with the database (and how to get the information displayed).
So for example one report would be displaying the following:
Store Reason for the Customer Call
breaks oil change shocks tune up total calls
5636 - Bloomington 2 4 0 2 8
8875 - Duluth 1 6 4 8 19
with links on the store name to pull up the information on that specific store. How would I change the database (listed below) to do this without foreign keys? Any help would be greatly appreciated.
call_log (table that contains the following:)
call_id
conv_number
date
camp_type (foreign key to the campaign table so it displays the campaign_id)
reason (foreign key to the call_reason table so it displays the reason_id)
location (foreign key to the store table so it displays the store_id)
associate
call_summary
trainig_issue (foreign key to the training_points table so it displays the training_key_id)
visit_closed
example (foreign key to the example_type table so it displays the example_id)
campaign (table that contains the following:)
campaign_id
campaign_name
campaign_promotion
campaign_coupon
campaign_startdate
campaign_enddate
call_reason (table that contains the following:)
reason_id
reason
store (table that contains the following:)
store_id
store_number
store_address
store_city
store_state
store_postalcode
store_name
store_phone
store_email
store_mgr
training_points (table that contains the following:)
training_key_id
key_issue
policy
example_type (table that contains the following:)
example_id
example_name
example_image
Thank you very much.Frankly, that is way to much of a question to be answered in detail on a forum... There's a lot involved and a lot of general database understanding required. I would highly recommend:
Database Design for Mere Mortals: A Hands-On Guide to Relational Database Design, Second Edition -- by Michael J. Hernandez
This is an invaluable book to get you going in the right direction and on a firm foundation.
Lawrence *Adobe Community Expert*
www.Cartweaver.com
Complete Shopping Cart Application for
Dreamweaver, available in ASP, PHP and CF
www.twitter.com/LawrenceCramer -
I Have a DW CS4 php question???
I completed this tutorial. > http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt3.html
GREAT Tut if you have not tried it. A big thank you to Ms. Dumitrascu.
My question is I put together this site while doing the tutorial. > http://www.bieberettes.com for a child and I would like to add a ban ip button/link to the admin area. If you do the tutorial you will find that on the admin page it adds a "delete this entry" and a "change status" to each post how hard would it be to add a "ban" based on the post? I'm not very savy in php so go easy on me.
Thank youHey Ned, thanks for your response. Here is a screen shot.
I hope you can see this, I don't think that I could have gotten it bigger. If you need to, I can send this directly to your emial, if it did'nt already go there.
John -
Hello,
Unfortunatly I don't know very much about .php and I was
hoping I could ask a very simple question.
Does your html page, that has a bit of referanced php, have
to be uploaded to your server to work? I'm working on a page and I
can't see the image the php is suppose to call up and I'm wondering
if its because it has to be uploaded to a host server before it
will display? I don't have a server at the moment to test it on and
would like to know if thats the problem or not.
Thanks!> Does your html page, that has a bit of referanced php,
have to be uploaded
> to
> your server to work?
PHP must be 'served' to work. That can be done by uploading
it to a PHP
capable server, or by previewing it locally if you have PHP
and a compatible
webserver installed in your local environment. Normally,
people would use
Apache, although I believe you can configure your local IIS
to serve PHP as
well. You can find explicit instructions for how to install
these locally
in many places on the web - but try Google with "WAMP" or
"XAMP".
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"c-fqgy" <[email protected]> wrote in
message
news:ghmj15$7u6$[email protected]..
> Hello,
> Unfortunatly I don't know very much about .php and I was
hoping I could
> ask a
> very simple question.
>
> Does your html page, that has a bit of referanced php,
have to be uploaded
> to
> your server to work? I'm working on a page and I can't
see the image the
> php is
> suppose to call up and I'm wondering if its because it
has to be uploaded
> to a
> host server before it will display? I don't have a
server at the moment to
> test
> it on and would like to know if thats the problem or
not.
>
> Thanks!
>
>
> -
I am not sure of my best course of action and would appreciate some input. My problem is this. I have written an application in java that communicates with a
micro controller and passes information back and forth.I read info from sensors and relays and make changes to them. My current GUI is set up with tables to
display this info. I am in the process of creating a graphics based interface to display the information in a web page but I am having trouble getting my
java program to update the HTML page. I have considered using java to update a database with values and then reading the database with PHP and updating the
HTML but I do not know how to get the java to run the PHP. I can use the java.awt.desktop API to display the html but I cant get it to display the .php files
due to the server issues with PHP. I am not sure what I am looking for here. Javascript? AJAX? What I want is for the user to push a button that loads a
web page and have java read that html file to determine which specific values to update, then update specific text boxes with those values from the
micro controller. I already have the communication with my current java program. I know this is all a little confusing and convoluted and I apologize for
that. I am just having a tough time formulating a plan of attack. Any ideas?
Thanks in advance,
Ray
Any ideas are welcome and greatly appreciated.I am not sure of my best course of action and would appreciate some input. My problem is this. I have written an application in java that communicates with a microcontroller and passes information back and forth.I read info from sensors and relays and make changes to them. My current GUI is set up with tables to display this info. I am in the process of creating a graphics based interface to display the information in a web page but I am having trouble getting my java program to update the HTML page. I have considered using java to update a database with values and then reading the database with PHP and updating the HTML but I do not know how to get the java to run the PHP. I can use the java.awt.desktop API to display the html but I cant get it to display the .php files due to the server issues with PHP. I am not sure what I am looking for here. Javascript? AJAX? What I want is for the user to push a button that loads a webpage and have java read that html file to determine which specific values to update, then update specific text boxes with those values from the microcontroller. I already have the communication with my current java program. I know this is all a little confusing and convoluted and I apologize for that. I am just having a tough time formulating a plan of attack. Any ideas?
Thanks in advance,
Ray
Any ideas are welcome and greatly appreciated. -
Populating an array of objects with a loop. Noob PHP question.
Hey guys,
You are all such a great help! Here is another one for you, the simple code below should create an array of pizza objects (and it does) then display each object in order. However... for some reason each object in the array seems to inherit the properties of whatever the last object entered was.
This code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php
class pizza{
public $price;
public $description;
public $name;
$menu2=fopen("pizzaMenu2.txt","r") or exit("System Error!");
$pizzas = array();
$arraypos=0;
//This loop does all of the READING and populating of variables
while(!feof($menu2))
//First get the array position
$arraypos = (int)fgets($menu2);
//Then Put in Title in title2 array
$pizzas[$arraypos2] = new pizza(0,0,0);
$pizzas[$arraypos2]->title = fgets($menu2);
$pizzas[$arraypos2]->description = fgets($menu2);
$pizzas[$arraypos2]->price = fgets($menu2);
} //End of reading loop
//begin writing data
$arraypos=1;
while ($arraypos <=3){
echo "the array is in position: ".$arraypos;
echo "<br />";
echo $pizzas[$arraypos2]->title;
echo "<br />";
echo $pizzas[$arraypos2]->description;
echo "<br />";
echo $pizzas[$arraypos2]->price;
echo "<br />";
$arraypos++;
}//end of writing data loop
fclose($menu2);
?>
<body>
</body>
</html>
returns this:
the array is in position: 1
Test Pizza Two
The same as one with an extra one, yum!
22.99
the array is in position: 2
Test Pizza Two
The same as one with an extra one, yum!
22.99
the array is in position: 3
Test Pizza Two
The same as one with an extra one, yum!
22.99
when it should return this:
the array is in position: 1
Test pizza One
Loaded with all that test pizza goodness! Lots and lots of ones 1111!
11.99
the array is in position: 2
Test Pizza Two
The same as one with an extra one, yum!
22.99
the array is in position: 3
Test Threeza!
Do you see what I did there? I added a three to pizza, hahaha, I am so punny.
33.33
using the following text file pizzaMenu2.txt:
1
Test pizza One
Loaded with all that test pizza goodness! Lots and lots of ones 1111!
11.99
3
Test Threeza!
Do you see what I did there? I added a three to pizza, hahaha, I am so punny.
33.33
2
Test Pizza Two
The same as one with an extra one, yum!
22.99
Now, I have done line by line testing and shown that the values are being entered into the proper objects in the proper array, but whatever goes in last overwrites all of the other objects, so in the end I have 3 objects in my array that are all the same. I am not sure what I am missing here.Christ-Guard wrote:
Thanks! I majored in computer science
That helps enormously.
Christ-Guard wrote:
Also, I have never worked a CS job before and I've been out of school for 8 years, so I am better at remembering "This should work" then I am at "This is how I write this code".
If you have a good idea something should work, based on theory, then that's half the battle.
Its having no knowledge if something will work or not when it becomes a problem. -
Flash Builder 4.5 for PHP question
Can I develop Coldfusion projects within Flash Builder 4.5 for PHP?
You will get better answers on ther CF forum...
Mylenium -
Php question: capturing data in a form for mysql update
I'm trying to update my database by building a form that
links a city with surrounding towns. I want to enter the main town
and the surrounding towns and then it updates all records that
contain the main town. the code runs without errors, but the data
i'm entering is not finding its way into the variables and doesn't
update the database . . . all help appreciated.
<form id="form1" name="form1" method="get"
action="demograph_updatep2.php">
<label><strong class="innerpageheading">Main
town</strong>
<input name="maintown" type="text" id="maintown" />
</label>
<p><label><span
class="results_13px">Nearby Town1</span>
<input name="nearbytown1" type="text" id="nearbytown1"
/>
</label>
</p>
<p>
<label><span
class="results_13px">NearbyTown2</span>
<input name="nearbytown2" type="text" id="nearbytown2"
/>
</label>
</p>
<p>
<label><span
class="results_13px">NearbyTown3</span>
<input name="nearbytown3" type="text" id="nearbytown3"
/>
</label>
</p>
<p>
<label><span
class="results_13px">NearbyTown4</span>
<input name="nearbytown4" type="text" id="nearbytown4"
/>
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="Update" />
</label>
</p>
</form>
<?php
// setting variables
$maincity = $_GET['maintown'];
$nearbycity1 = $_GET['nearbytown1'];
$nearbycity2 = $_GET['nearbytown2'];
$nearbycity3 = $_GET['nearbytown3'];
$nearbycity4 = $_GET['nearbytown4'];
mysql_connect (localhost,"");
mysql_select_db("") or die( "Unable to select database");
mysql_query("UPDATE physician
SET
physician_City2 = $nearbycity1
WHERE physician_City1 IN ($maincity)
mysql_close();
?>
<?php
mysql_connect (localhost,"");
mysql_select_db("") or die( "Unable to select database");
mysql_query("UPDATE physician
SET
physician_City2 = 'East Grand Rapids'
WHERE physician_City1 IN ('Grand Rapids')
mysql_close();
?>please ignore the last ten lines: ?>
<?php
mysql_connect (localhost,"");
mysql_select_db("") or die( "Unable to select database");
mysql_query("UPDATE physician
SET
physician_City2 = 'East Grand Rapids'
WHERE physician_City1 IN ('Grand Rapids')
mysql_close();
?>
i was using those to test the sql code -
Whats the best way to return someone to the page they came
from using a header redirect in php.
I have a script that process a form that is present on
multiple pages. After the form is submitted I would like to return
the user to the page the form was submitted from.
I have read using $_SERVER['HTTP_REFERER'] is not the
greatest... Even if I were to use this method I would still need a
way to remove any query string from the base url.
Can anyone offer some advice? Whats the best way to
accomplish something of this nature?
Thanks in advance!
JSorry for the dupe
-
I want to be able to create an if/else statement for the
formatting of a date cell in a dynamic result table.
This cell will turn red if the date returned is less than a
specified number of days older than todays date.
The trouble is, I don't know how to subtract days from a date
format....
$OldDateThreshold = (date("Y-m-d")-365); Where I am trying to
set a year old threshold. - this just returns a value of 1642?
I do hate this PHP, MySQL date format!My apologies for being unclear.
I have a Contact Database, within which is a field "Last
Checked". When record details are checked by a user, this field is
updated to today's date.
When doing mailmerges, this field is crucial as it quickly
highlights those records which are likely to be out of date.
I have a page with a dynamic table from a recordset which
contains all contacts to be included in a mailshot/mailmerge. In
the dynamic table is the field "last checked".
What I want to be able to do is have a form field (highlight
in red all those records last checked before...[ ]) with a
javascript function to call up a calendarised type date/time
picker. This javascript will then input the value selected (in
whatever format) into the form field.
When submitted, all records that have not been updated since
the threshold date will be highlighted using the else/if formatting
statement.
I understand the form variable now and have just put the
$_POST['datethreshold'] directly into the else/if code i.e.
<?php if ($row_mergelookup['LASTCHECK']
<$_POST['datethreshold']) { ?>.......else.....etc.
This does seem to partially work but there must still be an
issue with the date formatting.
The javascript is currently using YYYYMMDD as follows:
<a
href="javascript:NewCal('datethreshold','yyyymmdd')">
And it looks (when echo'd) visually like "yyyy/mm/dd"
This format does work for the majority of other recordsets in
other pages where a date variable is required (such as last edited
when?)
For whatever reason, if I enter a date such as 2007/02/01, it
highlights ALL records, even after that date.
If I enter 2006/02/01, it will highlight all records not
updated <2007.
It does not seem to be taking into account the MMDD.
Does this make more sense? -
PHP question - image manipulation
I have borrowed a page from a site I built last year that
allows one to
upload images, and resize them on the fly. It works really
well -
http://www.wildimages.biz/new-image-orig.php
Its code is here -
http://www.wildimages.biz/new-image-orig.txt
Now - I want this page to also automatically watermark the
images after they
have been resized, so I built this one by just adding the
image merge code -
http://www.wildimages.biz/new-image.php
Its code is here -
http://www.wildimages.biz/new-image.txt
But - it's curious, as the new page just writes the image to
the page, and
then ends without completing the page. I suppose it has
something to do
with the watermarking code I am using, but I'm not sure
where. Can someone
kind please take a look for me?
Thanks!
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================Got it. My problem was that I wasn't saving the newly
watermarked image
back onto the source image. Yippee!
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Murray *ACE*" <[email protected]> wrote
in message
news:[email protected]...
>I think the problem is the way that watermarking routine
ends with the
>header assignment. If I remove it completely, I get the
images without a
>watermark. If I leave it in, the page acts as if it's
just browsing
>directly to an image file, and ignores the rest of the
markup....
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
>
http://www.dreamweavermx-templates.com
- Template Triage!
>
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
>
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
>
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
> ==================
>
>
> "Murray *ACE*" <[email protected]>
wrote in message
> news:[email protected]...
>> Damn.
>>
>> I have borrowed a page from a site I built last year
that allows one to
>> upload images, and resize them on the fly. It works
really well -
>>
>>
http://www.wildimages.biz/uploads/new-image-orig.php
>>
>> Its code is here -
>>
>>
http://www.wildimages.biz/uploads/new-image-orig.txt
>>
>> Now - I want this page to also automatically
watermark the images after
>> they
>> have been resized, so I built this one by just
adding the image merge
>> code -
>>
>>
http://www.wildimages.biz/uploads/new-image.php
>>
>> Its code is here -
>>
>>
http://www.wildimages.biz/uploads/new-image.txt
>>
>>
>>
>> --
>> Murray --- ICQ 71997575
>> Adobe Community Expert
>> (If you *MUST* email me, don't LAUGH when you do
so!)
>> ==================
>>
http://www.dreamweavermx-templates.com
- Template Triage!
>>
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
>>
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
>>
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
>> ==================
>>
>>
>> "Joe Makowiec" <[email protected]>
wrote in message
>>
news:[email protected]...
>>> On 12 Feb 2007 in macromedia.dreamweaver.appdev,
Murray *ACE* wrote:
>>>
>>>>
http://www.wildimages.biz/new-image.txt
>>>
>>> 404
>>>
>>> --
>>> Joe Makowiec
>>>
http://makowiec.net/
>>> Email:
http://makowiec.net/email.php
>>
>>
>
> -
Advanced dreamweaver and php question
Hi I have a portal type of website for hairdressing and
beauty industry.
I am wanting to know if it is possible to have one register
form so that the the user can use more than one area:
Register for Directory/Classifieds - free registration and
use except for banner advertising
Register for Article Manager - free registratiion and use
Register to Search CV's - free registration and paid service
on a time limit
Register to place Job Advert & Search CV's - free
registration and paid service on a time limit
Register to place CV online for employers to pay and search -
free registration and use
I am currently using radio buttons to have all listings
inactive until approved by me to then change to active. Users on
registration can list their CV, Job Ad and Article but won't be
shown live until then. Job Ad, CV Search is a paid feature so I was
thinking of having session variables assigned to them.
I also have a radio button for the Job Ads and CV's that they
can hide or show public so that it is only shown live when they
need it to be.
Lastly I was going to have a radio button for expired or
notexpired so that when someone has registered and can still log in
to the system if it is expired there will be a note saying to renew
payment.
I know this sounds a lot but I would love that there is one
registration for customer convenience, one may want to place a
listing, article and search for CV's.
Lastly I am allowing the jobseekers to place their photo
portfolio of their work e.g. hairdoo's, make-up etc.
I want to allow all viewers to search and see these ( I will
try to watermark them for copyright ), but when they click on the
link they have restricted access to the CV until they pay.
I hope somebody understands what I mean, I guess I need to
restrict acces depending upon registration type and what would be
available to them.
Thanks for your time.jjjhbj111 wrote:
> I understand the Restrict Access to Page behaviour but
can someone have more
> than one access level?
Not with that server behavior. You would need to set access
levels based
on what a user is allowed to see. Level 1 for basic access,
level 2 for
a slightly higher level, and so on. If you want to have
different codes
for each type of access, you would then need to code all your
conditional statements by hand.
> I can't quite understand if they are already logged in
and they go straight to
> payments and return how the access level will change. Is
it because I do a
> mysql_insert_id()
It depends how you get acknowledgment that they have paid.
You already
know the current access level and user id, so use the payment
acknowledgment to trigger an update to the higher access
level.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Working with an API (PHP) question
I am building a mini-app using an API into another back-end
system. To
extract data from this system, I can use PHP lines like this
$stats = $q->campaignStats($cid);
where the variable "$q" has been previously loaded with
values.
What I want to know is - can I programatically generate this
line? What I'd
LIKE to do would be something like this (analogous to the way
that DW builds
query strings) -
$statsQuery = 'campaign' . $command . "($cid)"
and then I can set $command to any of a number of different
values, e.g.,
"ClickStats", "Bounces", "Unsubscribes", etc.
Now - what I don't know how to do is to then reference this
string in a way
that executes the command, as I'm fairly sure that -
$stats = $q->$statsQuery; would fail (but I'm going to try
it of course).
Is there a special way to handle such things?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================Thanks, Micha! My earlier imagined way didn't work, not
surprisingly!
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Michael Fesser" <[email protected]> wrote in message
news:[email protected]..
> .oO(Murray *ACE*)
>
>>I am building a mini-app using an API into another
back-end system. To
>>extract data from this system, I can use PHP lines
like this -
>>
>>$stats = $q->campaignStats($cid);
>>
>>where the variable "$q" has been previously loaded
with values.
>>
>>What I want to know is - can I programatically
generate this line? What
>>I'd
>>LIKE to do would be something like this (analogous to
the way that DW
>>builds
>>query strings) -
>>
>>$statsQuery = 'campaign' . $command . "($cid)"
>>
>>and then I can set $command to any of a number of
different values, e.g.,
>>"ClickStats", "Bounces", "Unsubscribes", etc.
>>
>>Now - what I don't know how to do is to then
reference this string in a
>>way
>>that executes the command, as I'm fairly sure that -
>>
>>$stats = $q->$statsQuery; would fail (but I'm
going to try it of course).
>
> The function name can be taken from a variable, so you
can use something
> like
>
> $statsQuery = "campaign$command";
> $stats = $q->$statsQuery($cid);
>
> For other ways of calling such "dynamic" functions have
a look at
> call_user_func() and call_user_func_array() if
necessary.
>
> Micha -
The most BASIC PHP question imaginable.
I am working my way through the Lynda.com PHP Essential Training.
I have MYSQL, Apache & PHP all installed an working.
If I type this code into textedit, and save it as test.php, and view it in Safari, then every works as expected:
<head>
<title>PHP test</title>
</head>
<body>
<?php echo "Hello World!"; ?>
</body>
</html>
and I see "Hello World!" on the screen.
If I create a new PHP file in Dreamweaver CS4 and enter
<?php echo "Hello World!"; ?>
I see that the code looks pretty much identical in the code pane, but when I run it, instead of seeing "Hello World" I see: <?php echo "Hello World!"; ?>.
Clearly, there is something (presumably to do with the server side, that I am not setting properly, BUT WHAT??? I am absolutely pulling my hair out over this.
Any suggestions??
Thanks,
PeterThis is a duplicate thread. Now locked.
Maybe you are looking for
-
Signal 4 error encountered while running a customized report
Signal 4 error encountered while running a customized report We are running Oracle Applications version 11.5.10 on Oracle RDBMS 9.2.0. and IBM AIX 5.3 o production system and AIX 5.2 on test machines. We have made a new clone of production database o
-
Freight Charges after doing GR in PO
Dear All, We have not entered any Freight charges in PO by mistake, And for that PO, already we have done GR also. Now how can add the freight charges to that PO ? Now the freight charge condn type in PO became as Grey.Can make it as editable after G
-
class Board public static void main(String[] args) Board example = new Board(); private Board(); char array[][]; array = new char[3][3]; for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++)
-
My Xperia M Dual (C2004) drops GPS frequently when outdoors; Other phones (with same network Sim Card) shows good GPS connection. I have tried different mobile network sim cards, M Dual continues to drop and search of GPS. Have tried different locati
-
No destination is currently free for parallel processing - SAPRCK10
Hello ABAPers, We have scheduled SAP standard program "SAPRCK10" in background processing at our production server on daily basis. It was worked fine on last week before but its now giving a error says "No destination is currently free for parallel p