There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox freezes freezing hard drive hardware hijackthis internet internet explorer itunes laptop mac malware motherboard mouse network networking outlook 2007 power printer problem ram restart router screen slow sound trojan usb virus vista vista 32-bit windows windows xp winxp wireless wmp
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Easy MySQL question


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
Regicide's Avatar
Senior Member with 304 posts.
 
Join Date: Aug 2003
Experience: Advanced
08-Sep-2004, 10:40 PM #1
Easy MySQL question
All I am trying to do is put in a varible in a mysql query in PHP. This is what I have now:
PHP Code:
$page $_GET['view'];
$db mysql_connect("localhost""root""pass");
mysql_select_db("test"$db);
$query "SELECT title FROM pages where page = '$page'";
$title mysql_query("$query"$db); 
For some reason this returns the value "resource id #2". But, when I use the same command in command line, it works fine. $page contains the right text, I've checked. Can someone please help me?
__________________
When you give everything and the feeling is gone
All the giving is fake, did you fake enough?
When you take everything and you stay too long
When there's nothing left, did you take enough?

Last edited by Regicide : 08-Sep-2004 10:48 PM.
clr's Avatar
clr clr is offline
Member with 41 posts.
 
Join Date: Aug 2004
Location: Kansas City
Experience: Web and Computer Programming
09-Sep-2004, 01:14 AM #2
has the $page variable already been assigned a value? That might cause a problem if it hasn't yet
Regicide's Avatar
Senior Member with 304 posts.
 
Join Date: Aug 2003
Experience: Advanced
09-Sep-2004, 01:28 PM #3
It holds the correct text. To make sure, I did printf("$page"). But other than that, it wasn't initalized until the $page = $_GET['view'].
clr's Avatar
clr clr is offline
Member with 41 posts.
 
Join Date: Aug 2004
Location: Kansas City
Experience: Web and Computer Programming
10-Sep-2004, 12:51 AM #4
hmm...i'm stumped....maybe try re-working some of your php...maybe capitalize the "WHERE" that could possibly cause probs with the SQL
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:36 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.