Jump to content

Works on my localhost but not on other sites


scripterdx

Recommended Posts

i´m a bit confusede, i´ve made a very simple mysql query, to show logged users (via Sessions), gets the user id and shows the email linked to that id.

 

           <?php $jbl ="SELECT `email` FROM `usuarios` WHERE `id` = '$user_id'"; 
$con = mysql_query($jbl);
$fila = mysql_fetch_assoc($con);
$emilio = $fila['email']; ?> 

 

that works prefectly on my localhost (appserv) but on my real server the one where my site is, it dosen´t works.

 

yes th DB is the same. thanks

Link to comment
Share on other sites

where is $user_id coming from?  need more code than just the query.

 

"it doesn't works" isn't sufficient information to help solve a problem.  i can't use that for any troubleshooting.  would you bring your car into a mechanics, toss him the keys and say, "it doesn't works"?  no.

 

post your code, explain what is happening and what should be happening.  post any error messages.  add:

 

 or trigger_error (mysql_error());

 

to the end of your query:

 

$con = mysql_query($jbl) or trigger_error (mysql_error());

 

and add:

 

ini_set ('display_errors', 1);
error_reporting(E_ALL);

 

to the very top of your script.

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.