Jump to content

mysql select exact word


cinos11

Recommended Posts

I want to be able to use php to go through a column in the table till it finds the exact name.

Then using that spot, inside the row look for other data.

 

I'll make a picture as an example:

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

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.