Jump to content

T_Logical_OR Parse error. Help is appreciated.


todayme

Recommended Posts

I have this error below, anyone got any ideas, I am sure it is a simple syntax error.

 

Parse error: syntax error, unexpected T_LOGICAL_OR in /home/admin/domains/sold.au.com/public_html/getlocation.php on line 16

 

 

<?

//set the variables as required

$dbhost = "localhost";

$dbuser = "admin_sex";

$dbpass = "sex";

$dbname = "admin_sex";

 

 

 

$db = mysql_pconnect($dbhost,$dbuser,$dbpass);

mysql_select_db($dbname) or die(mysql_error());

 

 

 

$data = mysql_query("SELECT * FROM _Industries WHERE Industry = '$dbIndustry'");

or die(mysql_error());

 

$info = mysql_fetch_array( $data );

 

$locationtype = $info['Location_Type'];

 

?>

<select name="Location"

><?php

 

  $query=mysql_query("("SELECT '$dbState' FROM '$locationtype'");

  while ($fetch=mysql_fetch_assoc($query)) {

    echo '<option value="'.$fetch['$dbState'].'">'.$fetch['$dbState'].'</option>';

  }

mysql_close($db);?></select>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

<?php
//set the variables as required
$dbhost = "localhost"; 
$dbuser = "admin_sex"; 
$dbpass = "sex"; 
$dbname = "admin_sex"; 

$db = mysql_pconnect($dbhost,$dbuser,$dbpass); 
mysql_select_db($dbname) or die(mysql_error());

$data ="SELECT * FROM _Industries WHERE Industry = '$dbIndustry' ";

$result1=mysql_query($data)or die("mysql_error()");

$info = mysql_fetch_array( $result1); 

$locationtype = $info['Location_Type']; 

?>
<select name="Location" >

<?php

  $query="SELECT '$dbState' FROM '$locationtype'";
  $result2=mysql_query($query) or dir("mysql_error()");
  
  while ($fetch=mysql_fetch_assoc($result2)) {
    echo '<option value="'.$fetch['$dbState'].'">'.$fetch['$dbState'].'</option>';
  }
mysql_close($db);?></select>

Link to comment
Share on other sites

Geting closer now I have this error after trying your code.

 

I am looking looking looking ha ha.

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/admin/domains/sold.au.com/public_html/getlocation.php on line 19

Link to comment
Share on other sites

what?

sorry corrected.

<?php
//set the variables as required
$dbhost = "localhost"; 
$dbuser = "admin_sex"; 
$dbpass = "sex"; 
$dbname = "admin_sex"; 

$db = mysql_pconnect($dbhost,$dbuser,$dbpass); 
mysql_select_db($dbname) or die(mysql_error());

$data ="SELECT * FROM _Industries WHERE Industry = '$dbIndustry' ";

$result1=mysql_query($data)or die("mysql_error()");

$info = mysql_fetch_array( $result1); 

$locationtype = $info['Location_Type']; 

?>
<select name="Location" >

<?php

 $query="SELECT '$dbState' FROM '$locationtype'";
 $result2=mysql_query($query) or die("mysql_error()");
 
 while ($fetch=mysql_fetch_assoc($result2)) {
   echo '<option value="'.$fetch['$dbState'].'">'.$fetch['$dbState'].'</option>';
 }
mysql_close($db);?></select>

Link to comment
Share on other sites

Here is the correct code incase anyone wants it.

 


<?php
//set the variables as required
$dbhost = "localhost"; 
$dbuser = "admin_sex"; 
$dbpass = "sex"; 
$dbname = "admin_sex"; 

$db = mysql_pconnect($dbhost,$dbuser,$dbpass); 
mysql_select_db($dbname) or die(mysql_error());

$data ="SELECT * FROM _Industries WHERE Industry = '$dbIndustry' ";

$result1=mysql_query($data)or die("mysql_error()");

$info = mysql_fetch_array( $result1); 

$locationtype = $info['Location_Type']; 




?>
<select name="Location" >

<?php

  $query=mysql_query("SELECT $dbState FROM $locationtype");
  while ($fetch=mysql_fetch_assoc($query)) {
    echo '<option value="'.$fetch[$dbState].'">'.$fetch[$dbState].'</option>';
  }
mysql_close($db);?></select>

[code/]

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.