|
|
|
<html>
<head>
<title>db Field Finder</title>
</head>
<body bgcolor=black text=#999999 alink=orange vlink=orange link=orange>
<?
//Paul Routledge qube@proqc.com //
//Cheezy Script to find MySQL tablenames - remove th@t for error msgs//
/*
CREATE TABLE tabs(db varchar(120) NOT NULL,tabs varchar(120) NOT NULL,fld varchar(120) NOT NULL)
*/
$dbn="test";//do the bit
$table="tabs";//do th bit
@mysql_connect("Heavenlyhost","UserBlame","aBsuRd");//do h bit
function bold($b,$name){$b=eregi_replace("$name","<font color=\"orange\"><b>$name</b></font>",$b);return($b);}
$nb=" | ";
echo"<h2>db Field Finder - switched off for obvious reasons.......</h2>
<form action=$PHP_SELF><input type=text name=field_name><input type=submit>
<br>Type a single word Phrase</form>";
if(!$field_name){return;}
@$db=mysql_list_dbs();
while(@$dbs=mysql_fetch_array($db))
{
$lt=mysql_list_tables($dbs[0]);
while($tabs=mysql_fetch_array($lt))
{
$lf=mysql_list_fields($dbs[0],$tabs[0]);
$f=mysql_num_fields($lf);
for($i=0;$i<$f;$i++)
{
if(mysql_field_name($lf,$i)==$field_name)
{
$fn=mysql_field_name($lf,$i);
$sql_query = "insert into $table values('$dbs[0]','$tabs[0]','$fn')";
echo"<b>Field \"<font color=red>$field_name</font>\"</b> is in
<b>Database [<font color=red>$dbs[0]</font> ]
Table [ <font color=red>$tabs[0]</font> <font class=a>]</font></b>";
echo$nb; echo mysql_field_type($lf,$i);echo$nb;echo mysql_field_len($lf,$i);echo$nb;
echo mysql_field_flags($lf,$i);
echo"<br>";
}
else
{
$fn=mysql_field_name($lf,$i);
$sql_query = "insert into $table values('$dbs[0]','$tabs[0]','$fn')";
$res= mysql_db_query($dbn, $sql_query);
}
}
}
}
echo"<p>";
$last="select fld,tabs,db from $table where fld like '%$field_name%' order by db,tabs,fld";
@$results = mysql_db_query($dbn, $last);
while(@$d=mysql_fetch_array($results))
{
echo"Search for <b><font color=red>\"</font>$field_name<font color=red>\"</font>
</b> is part of a fieldname in <b>Database [ <font color=red>$d[db] </font> ]
Table [ <font color=red>$d[tabs]</font> ] </b> ";
echo $field_name2=$b=bold($d[fld],$field_name);
echo"<br>";
}
$del_query="delete from $table";
@$del = mysql_db_query($dbn, $del_query);
@mysql_close();
?>
<br><br><small>Programming © <a href="mailto:qube@proqc.com">Paul Routledge</a> <?echo date(Y);?></small><br> |
|
| This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server. Categories : Databases, MySQL, Complete Programs, PHP, Databases | | | bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager Categories : MySQL, PHP, MySQL, Complete Programs, Databases | | | Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs. Categories : Databases, PHP, MySQL, Complete Programs | | | phpAds, a complete banner and ad management system with detailled tracking and stats. Categories : MySQL, Complete Programs, Ecommerce, PHP, Databases | | | Point and Click Interface ala MS Access for creating SQL statements. Categories : MySQL, Complete Programs, General SQL, PHP, Databases | | | Message of the Day - Random Message (Needs MySQL!) Categories : Databases, HTML and PHP, PHP, MySQL | | | email new items in db Categories : PHP, Email, Databases, MySQL, Beginner Guides | | | Alternating background color for HTML table rows Categories : PHP, Databases, MySQL, HTML and PHP | | | color codes for positive and negative numbers Categories : PHP, MySQL, Databases, HTML | | | A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL | | | Linked comboboxes with php-mysql & javascript Categories : PHP, Java Script, Databases, MySQL | | | mysql_escape_string Categories : PHP, MySQL, Databases, Strings | | | Automatically printing the contents of an sql table in MySQL. Categories : MySQL, PHP, HTML and PHP, Databases | | | usercounter class Categories : PHP, PHP Classes, Databases, MySQL, Environment Variables | | | This script is a contact form between users of a
website (kinda like the PM function on the forums)
Categories : PHP, Databases, MySQL, Regexps | |
|
|
|