Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > PHP

Reply
 
LinkBack Thread Tools Display Modes
Old 12-28-2004, 06:54 AM   #1 (permalink)
jimmyoctane
Registered User
 
jimmyoctane's Avatar
 
Join Date: Sep 2003
Location: California
Posts: 26
jimmyoctane is on a distinguished road
Send a message via AIM to jimmyoctane
Need a bit-o-guidence on passing parms to PHP

Hello

First off Happy holidays to all!!!!


I am trying to use a parmeter passed into a PHP script directly.

http://www.eteichertfineprints.com/l...=Grace%20Albee

hunk of script
PHP Code:
<?php include("includes/head.php");
$result=mysql_query("select * from images where artist_name = "$inartist" ");
and this is my error message

Parse error: parse error, unexpected T_VARIABLE in /home/eteicher/public_html/loadartist.php on line 2


so my question is can i use a parameter passed in to PHP script in a MYSQL statement?

Please forgive my newbieness.....
Thanks
Jimmy
jimmyoctane is offline   Reply With Quote
Old 12-28-2004, 07:16 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,475
sde is on a distinguished road
u have quotes inside quotes without isolating the variable with a period. this example encases the variable in single quotes. double quotes are used to close the string and attach the variable.
PHP Code:
<?
include("includes/head.php");
$result=mysql_query("select * from images where artist_name ='".$inartist."'"); 
?>
__________________
Mike
sde is offline   Reply With Quote
Old 12-28-2004, 07:55 AM   #3 (permalink)
jimmyoctane
Registered User
 
jimmyoctane's Avatar
 
Join Date: Sep 2003
Location: California
Posts: 26
jimmyoctane is on a distinguished road
Send a message via AIM to jimmyoctane
Perfect - Thank yo sir

If you werent a guy and didnt live so far away I'd kiss ya.....

Have a super New Years...and dont get busted racing!!!!!!!!


Take care
Jimmy
jimmyoctane is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP to Flash control panel roccoman PHP 1 11-24-2004 08:10 AM
PHP vs .NET Redline Lounge 1 11-24-2004 06:10 AM
PHP Comes of Age sde Code Newbie News 0 04-14-2004 11:41 AM
I need to learn PHP Nitro PHP 9 06-28-2003 11:24 AM
Passing form data to PHP with Javascript bdl PHP 5 07-03-2002 10:18 AM


All times are GMT -8. The time now is 10:47 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting