Jump to content

Recommended Posts

Help me with this simple query please 

1)The code below does not show any result and the page dies after that query

2)The below code does not show any error and it just stops the page to load after the query

3)The main thing here is it does not show any error and stops executing what could be the problem.

 

 

 

 

<?php

include('conn.php');

$sqls=mysql_query("SELECT * FROM languages")or die(mysql_error());

while($infos=mysql_fetch_array($sqls))

{

?>

 

<option value="<?php echo str_replace(" ","",$infos['name']); ?>"><?php echo $infos['name']; ?></option>

<?php 


?>
Link to comment
https://forums.phpfreaks.com/topic/276714-help-for-mysql_query/
Share on other sites

Apart from missing <select>... </select> tags I see no problem and no obvious cause. When I ran it using one of my tables with a name field I got a list of options.

 

Perhaps the cause comes later in the code

I have 3 drop downs and as soon as the code passes from this query it stops and other all dropdowns are loaded on browser and the later part does not have any php code. QUeries till now showed error but this one is not showing a error too

You won't get a dropdown without the select tags but you should get a list of the names - check the HTML source that is generated

sorry I was not able to explain properly. The remaining dropdows that are after the query are not been loaded though they have nothing to do with php....

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.