Jump to content

mysql select exact word


cinos11

Recommended Posts

when i do:

$result = mysql_query("SELECT path FROM cinos11_pages WHERE case='chatbox' ");
include($result);

it dont show when put into include and get this

Warning: include() [function.include]: Filename cannot be empty in /home/*in*s**/*in**s**.com/index.php on line 7

Warning: include() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/*in*s**/*in**s**.com/index.php on line 7

Use a while loop & mysql_fetch_*

 

Here's a good tutorial (see the bottom example):

http://www.tizag.com/mysqlTutorial/mysqlfetcharray.php

 

I can't use the while loop.

It disrupts the php switch which i have set up.

The only way i found so far to come up with is to display only the necessary text.

What does your current code look like?

 

And doing this: $result is not the actual text results, its the MySQL resource.

when i do:

$result = mysql_query("SELECT path FROM cinos11_pages WHERE case='chatbox' ");
include($result);

it dont show when put into include and get this

Warning: include() [function.include]: Filename cannot be empty in /home/*in*s**/*in**s**.com/index.php on line 7

Warning: include() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/*in*s**/*in**s**.com/index.php on line 7

What does your current code look like?

 

And doing this: $result is not the actual text results, its the MySQL resource.

when i do:

$result = mysql_query("SELECT path FROM cinos11_pages WHERE case='chatbox' ");
include($result);

it dont show when put into include and get this

Warning: include() [function.include]: Filename cannot be empty in /home/*in*s**/*in**s**.com/index.php on line 7

Warning: include() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/*in*s**/*in**s**.com/index.php on line 7

I ended up fiquring out $result wasn't the one

So i tried using this one:

 

<?php

// Make a MySQL Connection

mysql_connect("****", "*****", "*****") or die(mysql_error());

mysql_select_db("cinos11") or die(mysql_error());

 

// Get a specific result from the "example" table

$result = mysql_query("SELECT * FROM cinos11_pages

WHERE name='chatbox'") or die(mysql_error()); 

 

// get the first (and hopefully only) entry from the result

$row = mysql_fetch_array( $result );

// Print out the contents of each row into a table

echo $row['path']." - ".$row['case'];

?>

 

 

and it didnt work......

 

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.