This topic is locked
[SOLVED]

 Set a MySQL field as the Page URL

10/19/2016 12:29:09 AM
PHPRunner General questions
S
swanside author

Hi all

I am having a bit of a dilemma with an idea. I want to allow a user to log a request in my database. When they press save, I then want it to generate the URL to that logged job on the view page into a QRCode.
So basically the person logs in. Adds a new job and presses save. It then takes them back to list. If they view what they have just entered I want a QRCode with the URL to what they have viewed.

So in my SQL I have
SELECT

ID,

Username,

DateOfJobRequest,

DescriptionOfJob,

Page URL

FROM Job
So the Page URL with hold the URL to the view page.

Any ideas please?

Cheers

Paul.

S
swanside author 10/21/2016

Basically

I want the user to add info and it generates a QRCode to the URL of the View page of the info the user has entered?



Hi all

I am having a bit of a dilemma with an idea. I want to allow a user to log a request in my database. When they press save, I then want it to generate the URL to that logged job on the view page into a QRCode.
So basically the person logs in. Adds a new job and presses save. It then takes them back to list. If they view what they have just entered I want a QRCode with the URL to what they have viewed.

So in my SQL I have
SELECT

ID,

Username,

DateOfJobRequest,

DescriptionOfJob,

Page URL

FROM Job
So the Page URL with hold the URL to the view page.

Any ideas please?

Cheers

Paul.

Sergey Kornilov admin 10/21/2016

The typical View page URL looks like this:

tablename_view.php?editid1=XXXX


where XXXX is primary key value, lost likely ID in your example. Assuming that your database is MySQL and ID is a primary key field you don't even need a separate field for the URL but can calculate it on the fly in SQL Query:

SELECT

ID,

Username,

DateOfJobRequest,

DescriptionOfJob,

concat('tablename_view.pgp?editid1=', ID) as url

FROM Job
S
swanside author 10/21/2016

Cheers Sergey.

Owe you a drink for that mate <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=80499&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />



The typical View page URL looks like this:

tablename_view.php?editid1=XXXX


where XXXX is primary key value, lost likely ID in your example. Assuming that your database is MySQL and ID is a primary key field you don't even need a separate field for the URL but can calculate it on the fly in SQL Query:

SELECT

ID,

Username,

DateOfJobRequest,

DescriptionOfJob,

concat('tablename_view.pgp?editid1=', ID) as url

FROM Job