Jump to content

[SOLVED] Multiple $ help


nathan1

Recommended Posts

Hiya guys,

 

I have a problem with trying to post multiple id's...i have a url and im using $_GET['the id']..and thats fine, but i want to get two....

 

page.php$id=1$otherid=42

 

i want to do something like that.....

 

is that possible? how would i go about it?

 

thanks

Link to comment
Share on other sites

event.php?event_id=23?user_id=1

 

//getting the first id
$id = $_GET['event_id'];
$result = mysql_query("SELECT * FROM events WHERE event_id=$id") or die("Error querying customer database1");

 

//getting the first id
$user_id = $_GET['user_id'];

 

 

i get a error querying database, but i didnt get this error before i added the other $....so im thinking it cant tell were one ended and another began ?

 

 

 

Link to comment
Share on other sites

you want a question mark at the end of the filename so like this

 

page.php?

then you just list your items

id=what

eventid=whatever

then you add them together with a &

 

so like this

page.php?id=what&eventid=whatever

 

you need the & sign when there is more then 1 thing and for each thing just add another &

 

like this

page.php?id=what&eventid=whatever&something=this

 

help at all?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.