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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.