WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : db Field Finder - A Cheezy Script to Search For MySQL tablenames
Categories : PHP, Databases, MySQL Update Picture
Paul Routledge
Date : Apr 18th 2001
Grade : 3 of 5 (graded 1 times)
Viewed : 5847
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Paul Routledge
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

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



bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager
Categories : MySQL, PHP, MySQL, Complete Programs, Databases
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
MyOrgBook - Online Organizer written in PHP & MySql. Includes online contacts, todo, calendar, update, delete, insert, multi-user interface.
Categories : PHP, MySQL, Calendar, PDAs and Organizers, Databases
Simple usersOnline class - keep track of how many users are online on your site
Categories : PHP, PHP Classes, Databases, MySQL
Function to check connection to MySQL and redirect to an error page if an error occurs
Categories : MySQL, PHP, Debugging, Databases
MySQL Web Interface
Categories : MySQL, Databases, PHP
A PHP useradmin for MySQL. Uploading is easy. The only thing you need is PHP and MySQL installed!
Categories : MySQL, Databases, PHP, HTML and PHP
PostGreSQL and MySQL 2 in 1 db Manager
Categories : PHP, PHP Classes, Databases, PostgreSQL, MySQL
AJAX Data Grid System using php and mysql. A complete login system with the ability to display data in a grid using ajax. Add , update and delete the records without reloading the page.
Categories : PHP, AJAX, Databases, MySQL, Java Script
Loading Images to/from MySQL
Categories : Databases, MySQL, PHP, Graphics
Solution to those 'tell-a-friend' type email issues
Categories : PHP, Email, Databases, MySQL
PHP Object Example of the Perl DBI with MySQL
Categories : PHP, PHP Classes, MySQL, Databases, Perl
[PHP5] aDB PDO LIKE Database Abstraction. Switch easily from one db server to another, strong errors management, manage transactions, queries preparation and more.
Categories : PHP, PHP Classes, Databases, MS SQL Server, MySQL
Shopping Basket On-Line Ordering System.
Categories : Complete Programs, MySQL, PHP, Ecommerce, Databases
Simple function to return the number of days in a time span between 2 given dates.
Categories : PHP, Date Time, MySQL, Databases