hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : creating a link using a php variable
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

creating a link using a php variable

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 06-21-2004, 08:08 AM
stickygoblin stickygoblin is offline
Newbie
 
Join Date: Jun 2004
Posts: 17
*

creating a link using a php variable


hi

i know me again!!!

i'm stumped again with the insertion of a variable into a url string to place in a database:

PHP Code:

$link 
"http://www.rwascentenary.com/counties/$County.php";

$sql "INSERT INTO county_tbl SET Link ='$link'"
any suggestions as to how i would place the variable $County to name the file to be linked to.

if you have any suggestions as to how i would create the file - that would be really useful too as i know it's going to be tricky.

regards

sticky

Reply With Quote


Sponsored Links
  #2  
Old 06-21-2004, 08:11 AM
Loon Loon is offline
Community Liaison
 
Join Date: Apr 2003
Location: London, UK
Posts: 2,974
PHP Code:
$link 'http://www.rwascentenary.com/counties/'.$County.'.php'

Reply With Quote
  #3  
Old 06-21-2004, 08:36 AM
stickygoblin stickygoblin is offline
Newbie
 
Join Date: Jun 2004
Posts: 17
now when i try and place this into the database using the code:

PHP Code:
     $sql "INSERT INTO county_tbl SET " .
                
"County ='$County'" .
                
"Link ='$link'"
its returning an error of:

Error adding submitted county: You have an error in your SQL syntax near 'Link ='http://www.rwascentenary.com/counties/really.php'' at line 1

??

Reply With Quote
Sponsored Links
  #4  
Old 06-21-2004, 08:41 AM
Loon Loon is offline
Community Liaison
 
Join Date: Apr 2003
Location: London, UK
Posts: 2,974
Code:
$sql = "INSERT INTO county_tbl (County, Link) VALUES ('$County', '$link')";

Reply With Quote
  #5  
Old 06-21-2004, 09:31 AM
stickygoblin stickygoblin is offline
Newbie
 
Join Date: Jun 2004
Posts: 17
cheers thanks for the help.

do you have any idea where i can find a tutorial for how to create a php page (so the link goes somewhere)

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
WHD.india 2013 Web Hosting Events 2013-05-22 13:02:04
Web Host Webhostforasp.net Launches New Affiliate Program Web Hosting News 2012-01-16 14:31:12
The Variable Requirements of Data Center Vendor Selection: Andrew Schaap of Digital Realty Trust Web Hosting News 2011-09-27 15:06:29
NTT America Launches Global Virtual Link Web Hosting News 2011-07-27 20:34:43
Web Host CoreLink Data Centers Adds New Managed Network Services Web Hosting News 2011-06-21 16:03:56


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?