Jul 24, 2008

Error Importing Sql Query Via Php - Works in PHPmyAdmin

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

Error Importing Sql Query Via Php - Works in PHPmyAdmin

Arne-Christian
CODE
    function sql()
    {
        $fp = fopen("sql.sql","r");
        $sql = fread($fp,filesize("sql.sql"));
        fclose($fp);
        return $sql;
    }


Thats $this->sql and here is the other source
CODE
function insert_sql()
    {
    if($_GET['insert'])  {
        $template = new template;
        $db = new db;
        $db->connect();
        $query = $this->sql();
        
        $query = $db->query($query) or die("Error!: " . mysql_error());
        return $query;
        $return = "<div align=\"center\"> <br>
      <table width=\"579\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">
          <tr>
              <td width=\"577\" class=\"header\"><div align=\"center\" ><strong>Create User </strong></div></td>
          </tr>
            <tr>
              <td class=\"footer\"><br /><label>
                <div align=\"center\"><strong>17</strong> Tables has been insert to MySQL Database </div>
              </label><br /></td>
            </tr>
          </table>
          <br>
      </div>";
      #return $return;
    }
    elseif(!$_GET['insert']) {
        $return = "<div align=\"center\"><table width=\"579\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">
          <tr>
              <td width=\"577\" class=\"header\"><div align=\"center\" ><strong>Information </strong></div></td>
          </tr>
            <tr>
              <td class=\"footer\"><br /><label>
                <div align=\"center\">Click this button to start insert the SQL Tables
                  <input type=\"submit\" name=\"Submit\" value=\"Submit\" onClick=\"java script:location.href='install.php?do=2&insert=true';\" />
                </div>
              </label><br /></td>
            </tr>
          </table></div>";
          return $return;
         }
    }


Any ideas how to fix it, oh and here is the SQL query:
CODE
DROP TABLE IF EXISTS `eb_badword`;
CREATE TABLE `eb_badword` (
  `bid` int(15) NOT NULL auto_increment,
  `text` varchar(225) NOT NULL,
  PRIMARY KEY  (`bid`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `eb_category`;
CREATE TABLE `eb_category` (
  `id` int(15) NOT NULL auto_increment,
  `category` varchar(225)  NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

INSERT INTO `eb_category` VALUES (1, 'Test Category');

DROP TABLE IF EXISTS `eb_forums`;
CREATE TABLE `eb_forums` (
  `id` int(4) NOT NULL auto_increment,
  `cid` int(4) NOT NULL,
  `title` varchar(255)  NOT NULL,
  `description` varchar(255)  NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

INSERT INTO `eb_forums` VALUES (1, 1, 'Test forum', 'EvilBoard -> Test forum');

DROP TABLE IF EXISTS `eb_group`;
CREATE TABLE `eb_group` (
  `g_id` int(15) NOT NULL auto_increment,
  `name` varchar(225)  NOT NULL,
  `clr` varchar(225)  NOT NULL,
  `inf` varchar(225)  NOT NULL,
  `status` enum('open','closed')  NOT NULL,
  `u_id` varchar(225)  NOT NULL,
  PRIMARY KEY  (`g_id`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `eb_group_mem`;
CREATE TABLE `eb_group_mem` (
  `id` int(15) NOT NULL auto_increment,
  `grp_id` varchar(225)  NOT NULL,
  `userid` varchar(225)  NOT NULL,
  `admin` enum('normal','admin')  NOT NULL default 'normal',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `eb_group_val`;
CREATE TABLE `eb_group_val` (
  `u_id` varchar(225)  NOT NULL,
  `val_id` varchar(225)  NOT NULL,
  `g_id` varchar(225)  NOT NULL
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `eb_members`;
CREATE TABLE `eb_members` (
  `userid` int(25) NOT NULL auto_increment,
  `first_name` varchar(25)  NOT NULL default '',
  `last_name` varchar(25)  NOT NULL default '',
  `email_address` varchar(25)  NOT NULL default '',
  `username` varchar(25)  NOT NULL default '',
  `password` varchar(255)  NOT NULL default '',
  `info` text  NOT NULL,
  `user_level` enum('0','1','2','3')  NOT NULL default '0',
  `signup_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `last_login` datetime NOT NULL default '0000-00-00 00:00:00',
  `activated` enum('0','1')  NOT NULL default '0',
  PRIMARY KEY  (`userid`)
) ENGINE=MyISAM  COMMENT='Membership Information';

DROP TABLE IF EXISTS `eb_moderator`;
CREATE TABLE `eb_moderator` (
  `mid` mediumint(8) NOT NULL auto_increment,
  `forum_id` int(5) NOT NULL,
  `member_name` varchar(32)  NOT NULL,
  `member_id` mediumint(8) NOT NULL,
  `edit_post` smallint(1) NOT NULL,
  `delete_post` smallint(1) NOT NULL,
  `view_ip` smallint(1) NOT NULL,
  PRIMARY KEY  (`mid`)
) ENGINE=MyISAM  COMMENT='EvilBoard Moderators';

DROP TABLE IF EXISTS `eb_pm`;
CREATE TABLE `eb_pm` (
  `id` int(15) NOT NULL auto_increment,
  `message` text  NOT NULL,
  `title` varchar(225)  NOT NULL,
  `from` varchar(225)  NOT NULL,
  `to` varchar(225)  NOT NULL,
  `postdate` datetime NOT NULL,
  `UserID` varchar(155)  NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `eb_post`;
CREATE TABLE `eb_post` (
  `message` text  NOT NULL,
  `postdate` datetime NOT NULL,
  `UserID` varchar(225)  NOT NULL,
  `Username` varchar(225)  NOT NULL,
  `PostID` int(15) NOT NULL auto_increment,
  `TopicID` varchar(225)  NOT NULL,
  `ForumID` varchar(225)  NOT NULL,
  `title` varchar(225)  NOT NULL,
  `user_ip` varchar(32)  NOT NULL,
  PRIMARY KEY  (`PostID`)
) ENGINE=MyISAM;

INSERT INTO `eb_post` VALUES ('<p>If you are able to read this post, EvilBoard has been successfully installed on your webserver, you can remove this topic, forum, and even the category from your admin panel.</p><p>A test of emoticons:</p><p><img src=\'Emoticons/1/smiley-cool.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-cry.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-embarassed.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-innocent.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-yell.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-wink.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-undecided.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-tongue-out.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-surprised.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-smile.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-sealed.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-money-mouth.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-laughing.gif\' alt=\'\' /><img src=\'Emoticons/1/smiley-kiss.gif\' alt=\'\' /></p><p>If you can see 14 pictures here, all the Emoticons are working.</p><p>Enjoy EvilBoard, and please submit bugs at http://www.cs-gladz.com/evilboard/&nbsp; (Forum: Report EvilBoard Bugs)</p><p>~ The EvilBoard Group&nbsp;</p>', '2006-09-28 22:40:46', '0', 'The EvilBoard Group', 1, '1', '1', 'Test Topic', '127.0.0.1');

DROP TABLE IF EXISTS `eb_profile`;
CREATE TABLE `eb_profile` (
  `name` varchar(255)  NOT NULL,
  `logo` varchar(255)  NOT NULL,
  `rank` varchar(255)  NOT NULL,
  `email` varchar(255)  NOT NULL,
  `msn` varchar(255)  NOT NULL,
  `yahoo` varchar(255)  NOT NULL,
  `icq` varchar(255)  NOT NULL,
  `aim` varchar(255)  NOT NULL,
  `location` varchar(255)  NOT NULL,
  `website` varchar(255)  NOT NULL,
  `intr` text  NOT NULL,
  `alias` varchar(255)  NOT NULL,
  `age` varchar(255)  NOT NULL,
  `mpad` varchar(255)  NOT NULL,
  `hps` varchar(255)  NOT NULL,
  `mouse` varchar(255)  NOT NULL,
  `cpu` varchar(255)  NOT NULL,
  `mboard` varchar(255)  NOT NULL,
  `ram` varchar(255)  NOT NULL,
  `monit` varchar(255)  NOT NULL,
  `gpcard` varchar(255)  NOT NULL,
  `id` int(15) NOT NULL auto_increment,
  `sig` text  NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `eb_psettings`;
CREATE TABLE `eb_psettings` (
  `UserID` int(155) NOT NULL auto_increment,
  `h_mail` enum('0','1')  NOT NULL,
  `s_pm` enum('0','1')  NOT NULL,
  `s_update` enum('0','1')  NOT NULL,
  `p_sig` enum('0','1')  NOT NULL,
  `p_avy` enum('0','1')  NOT NULL,
  PRIMARY KEY  (`UserID`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `eb_ranks`;
CREATE TABLE `eb_ranks` (
  `rid` int(15) NOT NULL auto_increment,
  `rname` varchar(225)  NOT NULL,
  PRIMARY KEY  (`rid`)
) ENGINE=MyISAM;

INSERT INTO `eb_ranks` VALUES (1, 'Member');
INSERT INTO `eb_ranks` VALUES (2, 'Moderator');
INSERT INTO `eb_ranks` VALUES (3, 'Administrator');

DROP TABLE IF EXISTS `eb_settings`;
CREATE TABLE `eb_settings` (
  `homepage` varchar(225)  NOT NULL,
  `forum_name` varchar(225)  NOT NULL,
  `eb_version` varchar(10)  NOT NULL,
  `register` enum('0','1','2')  NOT NULL,
  `e_domain` varchar(225)  NOT NULL,
  `path` text  NOT NULL,
  `post_per_page` mediumint(15) NOT NULL default '20',
  `topic_per_page` mediumint(15) NOT NULL default '25',
  `members_per_page` mediumint(15) NOT NULL default '25',
  `badword_replace` varchar(1)  NOT NULL default '*'
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `eb_smiley`;
CREATE TABLE `eb_smiley` (
  `cmd` text  NOT NULL,
  `img` text  NOT NULL,
  `id` int(15) NOT NULL auto_increment,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

INSERT INTO `eb_smiley` VALUES (':cool:', 'smiley-cool.gif', 10);
INSERT INTO `eb_smiley` VALUES (':cry:', 'smiley-cry.gif', 9);
INSERT INTO `eb_smiley` VALUES (':embrassed:', 'smiley-embarassed.gif', 14);
INSERT INTO `eb_smiley` VALUES (':angel:', 'smiley-innocent.gif', 12);
INSERT INTO `eb_smiley` VALUES (':yell:', 'smiley-yell.gif', 15);
INSERT INTO `eb_smiley` VALUES (':wink:', 'smiley-wink.gif', 16);
INSERT INTO `eb_smiley` VALUES (':uhh:', 'smiley-undecided.gif', 17);
INSERT INTO `eb_smiley` VALUES (':p', 'smiley-tongue-out.gif', 18);
INSERT INTO `eb_smiley` VALUES (':surprised:', 'smiley-surprised.gif', 19);
INSERT INTO `eb_smiley` VALUES (':smile:', 'smiley-smile.gif', 20);
INSERT INTO `eb_smiley` VALUES (':sealed:', 'smiley-sealed.gif', 21);
INSERT INTO `eb_smiley` VALUES (':money-crazy:', 'smiley-money-mouth.gif', 22);
INSERT INTO `eb_smiley` VALUES (':haha:', 'smiley-laughing.gif', 23);
INSERT INTO `eb_smiley` VALUES (':kiss:', 'smiley-kiss.gif', 24);

DROP TABLE IF EXISTS `eb_topic`;
CREATE TABLE `eb_topic` (
  `UserID` varchar(225)  NOT NULL,
  `title` varchar(225)  NOT NULL,
  `TopicID` int(225) NOT NULL auto_increment,
  `replays` varchar(225)  NOT NULL,
  `desc` varchar(225)  NOT NULL,
  `Username` varchar(225)  NOT NULL,
  `ForumID` varchar(225)  NOT NULL,
  PRIMARY KEY  (`TopicID`)
) ENGINE=MyISAM;

INSERT INTO `eb_topic` VALUES ('1', 'Test Topic', 1, '0', '', 'The EvilBoard Group', '1');


And the error is:
Error!: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; CREATE TABLE `eb_badword` ( `bid` int(15) NOT NULL auto_increment, `tex' at line 1

 

 

 


Reply

hts
I think the problem is the ' character before and after the table name...get those out of your code and try again..tell back if it works:)

Reply

Arne-Christian
' dosnt exsist tongue.gif its the same as "textasdasd"

Reply

hts
CREATE TABLE `eb_badword` (
`bid` int(15) NOT NULL auto_increment,
`text` varchar(225) NOT NULL,
PRIMARY KEY (`bid`)
) ENGINE=MyISAM;") or die(mysql_error());

I`m talking about those (red characters:) )..my queries have no such chars, but I tried putting these before and after the table name and it gave an error..so just try getting thost chars out..smile.gif

Reply

electron
These characters are allowed and infact they act as a distinguishing factor if the name of the table or field resembles a name of a MySQL function like SUM .
It is advisable to use it rather.

By the way Arne-Christian you have used a class in PHP but not given the entire class and gave only the functions.
Please post the entire class.

Reply

hts
QUOTE(electron @ Oct 1 2006, 09:27 AM) *

These characters are allowed and infact they act as a distinguishing factor if the name of the table or field resembles a name of a MySQL function like SUM .
It is advisable to use it rather.

By the way Arne-Christian you have used a class in PHP but not given the entire class and gave only the functions.
Please post the entire class.


hmm..then there`s something wrong with my mysql queries smile.gif ..as I told you, I get an error when using ' '...I`ll check this out biggrin.gif..thank you for the information

Reply

Arne-Christian
Not needed, answer was simple, create an array, put 1 query in each, and use foreach hehe tongue.gif, But thanks anyways

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : error, importing, sql, query, php, works, phpmyadmin

  1. Mysql Error
    (3)
  2. Sql Query
    Mistake? (19)
    Hi, everyone! What is the mistake over here? CREATE TABLE '1_users' ( 'id'
    INT(11) NOT NULL AUTO_INCREMENT, 'username' VARCHAR(255) NOT NULL, 'password'
    VARCHAR(255) NOT NULL, PRIMARY KEY ('id') ) TYPE MYISAM; The PHPMyAdmin states: QUOTE
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
    version for the right syntax to use near ''1_users' ( 'id' INT(11) NOT NULL
    AUTO_INCREMENT, 'username' VARCHAR(255) NOT ' at line 1 Please, let me k....
  3. Php Objects: Catchable Fatal Error
    There is a weird problem with objects in php 5.2.2 (4)
    in php 4.4.7 my code seems to be ok but in later version 5.2.2 i get this error Catchable fatal
    error: Object of class mission_rank could not be converted to string in
    /Applications/xampp/xamppfiles/htdocs/nexus/includes/forms/cn_reload.php on line 41 cn_reload.php
    include('../class/userClass.php'); session_start(); $app_user =&
    $_SESSION ; if ($app_user->character != false) { $race_letter =
    array('H','E','T','M','G'); $cn_id = 0; foreach
    ($app_user->character as....
  4. T_string Error Please Assist
    (5)
    I have unexpected t_strings in 3 lines they are CODE <?php // $Header$ //this
    script may only be included - so its better to die if called directly. if
    (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !==
    false) {   header("location: index.php");   exit; } /* A basic library to
    handle a cache of some Tiki Objects, usage is simple and feel free to improve it */ class Cachelib
    {   var $folder;   function Cachelib() {         global $tikidomain;
            $th....
  5. Phpmyadmin Login Problem!
    (1)
    I have easyphp. But i can not log when i go to phpmyadmin. I directly enter the page. But i think i
    should normally have to log in before enter that page. What should i do to configure the access to
    phpmyadmin? Thank for help....
  6. Phpbb2 Error
    recently showing up (4)
    I tried to install a mod. Did it successfully but didn't like the end result. So I went through
    the install backwards and reverted everything back to how they were. Now I am getting this error.
    QUOTE Warning: Cannot modify header information - headers already sent by (output started at
    /home/damen/public_html/phpBB/language/lang_english/lang_main.php:1034) in
    /home/damen/public_html/phpBB/includes/page_header.php on line 483 Warning: Cannot modify header
    information - headers already sent by (output started at
    /home/damen/public_html/phpBB/language/lang_english....
  7. Simple Mysql Query Limiting
    (9)
    Simple MySQL Query Limiting CODE <?php // If mypage?limit=blah is not defined returs 5
    if ( $_GET['limit'] == NULL ) {     $limit = 5; } // Else else {
        $limit = $_GET['limit']; } $query = mysql_query("SELECT
    * FROM members LIMIT '$limit'") or die(mysql_error()); while
    ($sql = mysql_fetch_array ($query) ) {     echo
    $sql['mem_name'] . '<br>'; } ?> Have fun......
  8. Php Fsockopen() Error
    (14)
    Hi guys, I've been having problems with PHP and my Apache server, I've got this book (SAMS
    PHP, MYSQL and Apache All in One) I've installed all services correctly, but I get an error on
    my Radio Homepage saying: QUOTE Warning: fsockopen() : unable to connect to 5.106.1.74:8000 (A
    non-blocking socket operation could not be completed immediately. ) in C:\Program
    Files\Apache Group\Apache2\htdocs\radio\stats\radio_stats.php on line
    13 Riphabbo Radio Is Currently Offline I'm new to PHP and would like to know if th....
  9. Error On Emailer.php & Smtp.php At Phpbb
    ERROR on emailer.php & smtp.php at PhpBB (2)
    Are you use free webhosting??? smtp.php and emailer.php are general error on CMS like phpBB . It
    make email verification disabled.Why??? because free webhosting not allow us use smtp port .they
    afraid their server will atacking with spam !! so what solution to solve this problem?? You
    can search on google or join at phpBB forum !!! but if it can not solve all this problem
    it only able 1 trick ..you must download emailer MOD at www.phpbbhacks.com to inactive emailer.php
    or smtp.php ....
  10. Mysql Query
    (2)
    theres a bug somewhere in this query and i can't seem to find it. does anyone else see it?
    CODE $query = "insert into templates
    (tuid,tname,tdescription,template,archivedefault) values (1,'Sample Archive
    Template','A sample archive template that only shows the name of the article with a link to
    the default article viewer.','<a
    href='viewarticle1.php?aid=[id]'>[articletitle]</a>',FALSE&#
    41;"; ....
  11. Error With Joomla Template
    cant find function (1)
    Hello! I am working on my template in Dreamweaver and i am using joomla extensions for
    dreamweaver! When i start my page with joomla stand alone server(jsas) i get this errors on the
    bottom of the page! QUOTE Warning:
    mosloadcomponent(w:/www/Joomla/components/com_banner/banner.php) : failed to open stream: No such
    file or directory in w:\www\Joomla\includes\frontend.php on line 66 Warning:
    mosloadcomponent(w:/www/Joomla/components/com_banner/banner.php) : failed to open stream: No such
    file or directory in w:\www\Joomla�....
  12. Help Improving My Login Script Code
    The code works okay...just not the authorization part (4)
    I have developed a piece of code /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
    alt="smile.gif" /> that is going to work as my login script for my website. I need some help making
    improvements and creating additional features. Here is my code: CODE <?php
    session_start(); $name = $_POST['username']; $password =
    $_POST['password']; $con =
    mysql_connect("localhost","myDbUser","myDbPassword");
        if(!$con)         {         die(&#....
  13. Importing .csv Into Mysql Database
    NEED HELP! (6)
    I need help importing a .csv contents into a Mysql database. I have this. But its not working.
    CODE <?php connection = mysql_connect("******", "**********",
    "********") or die ("Unable to connect to server"); $db =
    mysql_select_db("b9_259782_CC", $connection) or die ("Unable to select
    database"); fopen ('csvranks.csv', 'r');
    mysql_query("INSERT INTO test_table (id, name, guild, level, exp) ?> What
    am I doing wrong? The mys....
  14. Using And?or In A Mysql Query
    (2)
    hi everyone,


    I have been trying to get a script to come up with the total number of comments a news item has
    under it
    news ....
  15. [forum] Double Posting Happening By An Error
    (3)
    Hello, I am currently working on EvilBoard 0.1.1, for those who know about this project versjon 0.1b
    can be downloaded from http://www.evilservices.com Well over to the reason why i am posting this,
    I am currently experincing a problem with my new posting code wich has been rewrited in version
    0.1.1, You see, it is double posting by an error, i thouht i could fix that myself, but no, so i
    just thought, Trap17 is perfect, they problety know how to fix this, Here is the code: CODE
    <? /* * @Name: Post Topic * @Author: Arne-Christian Blystad * @Copyright&....
  16. Making A Sig With Php
    just wondering how it works (7)
    I was just wondering how to make an image that uses stuff given to it by php, yet remains only an
    image - say I want the site's title in an image. I believe it has something to do with putting
    an index.php inside a folder called image.png or whatever. Am I right? thanks....
  17. Help Needed With Silly Error
    (8)
    Hi i have made a stupid error on one of my pages and having trouble finding it. It says unexpected
    ')' on line 114 can anyone please help me find it? Here is the page: CODE <? /** *
    * @package TibiaME Clan/Download Site * @version 1.00 2006/09/27 00:04:37 wappy * @copyright
    (c)2004-2006 wappyCULT * @home http://hack.s-60.org * @license You can use/modify this
    script but distributing it without permisinn, or removing the "Script By: wappy" link
    will invalidate your license and give wappy (wappyCULT) FULL RIGHTS to ....
  18. Form Dosn't Submit In Opera
    Works in IE and FireFox (1)
    My form dosn't submit, it works in IE and FF, its validated HTML 4.01 and all, Code:
    /**********************************/ /** Post Topic :: EvilBoard **/
    /**********************************/ /* Session Start */ session_start(); /* Start Submit Script */
    if ( isset($_POST )) { header("Refresh: 0; redirect.php?posttopic");
    define("RELOADED","YES"); } /* End Submit Script */ /* Include File::Header.php */
    include("include/header.php"); echo " "; /* If Script can't find SESSION user_name */ if (
    !$_SESSION ) { /* Echo :: Forbiden */ echo '....
  19. Detect Image Resolution Without Gd
    Also stop error if not found (1)
    Hi, I have come accross some starnge problem in PHP. I wanted to detect the image resolution in
    of a URL specified by the user. This is possible via getimagesize() function of PHP that is
    independent of GD library. But this function generates a E_WARNING Error if the image is not there.
    What shall i do to stop this warning ?? I dont want to show the Error in PHP style but my style of
    error reporting. Please help me.....
  20. Uglymonkey Toplist Script
    Getting an error with this script, please help. (7)
    I'm getting an error on the index page.Need help to fix it please. There's the error:
    CODE Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
    resource in /home/chatz/public_html/top/index.php on line 10 Failed: delete from
    uglymonkey_toplist where lastin < '2006-07-28 18:23:19' and total='0'
    Here's the index page that I'm getting the error on: CODE <?php
    include("config.php"); if ($purgedays>0){     $purgeseconds =
    $purged....
  21. Freetype, Gd And An Error
    I just can't get FreeType to work (1)
    Basically I have this code: CODE header("Content-type: image/png");
    $bgimg = "bg.png"; $im = imagecreatefrompng($bgimg); $number =
    rand(10,99); $textcolour = imagecolorallocate($im, 255, 255, 255);
    $font = "arial.ttf"; imagettftext($im, 65, 0, 5, 95, $textcolour,
    $font, $number); imagepng($im); imagedestroy($im);
    Unfortunately all I get is the blank placeholder for an image (or the red X if you still use IE)
    rathe....
  22. Phpmyadmin And Php And Mysql
    tutorial (0)
    hi i think phpmyadmin is nice script (3rdparti) to learn php and mysql , you can add database and
    then make tabel with rows and columns then you can customise (search , show rows , show columns ,
    add rows , delete rows) tabel in phpmyadmin when you are customise phpmyadmin , this script show you
    php code . you can use this code for browse in database . for example : showing tabel : CODE
    SELECT * FROM `tabelname` LIMIT 0 , 30 searching : CODE SELECT `columns`
    FROM `tabel` LIMIT 0 , 30 you can use with while loop showing Ascending....
  23. Php Form Help!
    Parse error T_LNUMBER - expecting T_VARIABLE (3)
    Hello, I am trying to make an employee application. I was just wondering if anyone knows how to spot
    a php code error, when the code directly around the line with the error looks the same. below is
    some of my process.php code. I beleive the error is on line 41. QUOTE PHP parse error: PHP
    Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in
    /home/wwwange/public_html/FORMS/forms/process.php on line 41 Process.php code: CODE
    <?php include("global.inc.php"); $errors=0; $error="The foll....
  24. Script Won't Work At Trap17 -- Version Differences?
    But works flawlessly in my machine... (12)
    Here is the code: CODE <?php $data_array = array(); $data_array2 =
    array(); $file_name = "menu_data.txt"; $handle =
    @fopen($file_name, "r"); if (!$handle)  {     echo "File
    Handle Not Available For Use"; exit;         } while (($data = fgetcsv(
    $handle, 1000, ",")) !== FALSE) {         if ( (strpos
    ($data[2],"$page=")))     {
                        $data_array[] =  t....
  25. Help Installing Phpmyadmin ..
    (2)
    i've installed php and mysql to my computer and i want to install PhpMyAdmin , (i have apache) ,
    i tried to find how to confure it , and it says Create the file config.inc.php in the main
    (top-level) directory , i dont know how to create that file..can some one tell me how i can confure
    that config file ?? and how i can run php in safe mode ?....
  26. Php Error When Running Script
    Php error when running script (3)
    Hello, I get the following error: Parse error: syntax error, unexpected T_STRING in
    /usr/local/psa/home/vhosts/club-amigos.co.uk/httpdocs/contact.php on line 44 when l run the
    following script: Any help would be appreciated. CODE <?php /* PHP Form Mailer -
    phpFormMailer v2.1, last updated 30th Nov 2005 - check back often for updates! (easy to use
    and more secure than many cgi form mailers) FREE from: www.TheDemoSite.co.uk Should work
    fine on most Unix/Linux platforms */ // ------- three variables you MUST change below
    -------------....
  27. Query Not Running When Submitting A Form
    (3)
    Im having trouble getting my PHP to work. Basically i have a form with a button linking to a php
    file. When i click submit it calls this file and is suppost to add the data to a database. Im using
    a my sql databse and it connects fine. Unfortunately when i click submit all i get is the
    "Inspection did not add". From this i know i have made a connection with the database and im
    absolutely 100% sure that all field names are correct on the forms and database. Any ideas? Heres
    the script.... PHP Code: CODE <html> <head> <meta http-equiv="C....
  28. Suppressing Mysql Error In Php
    How to suppress auto generated mysql err (4)
    I am testing my website on my local machine. It is still in development stage and I am using
    php/mysql. If there is a mysql connection error, I am checking for the connection variable and
    displaying a proper error message. But even before it displays my error message, it displays an
    error message on browser thrown by mysql (MySQL Connection Failed: Access denied for user). Can I
    suppress this message and display only my message?....
  29. Parse: Error Unexpected T_lnumber
    php parse error when running script (4)
    Hi. I've just created a php script. The main object of the script is to delete some old files
    and replace it with a new file with some new content, effectively moving the contents from one file
    to another. These are the first 50 lines of the file: /* Calculate For The "A" Group - The
    Latest Games ID */ $a_B = 002; while(file_exists("a_" . $a_B . ".dat")) {
    $a_B++; } $new_page_contents = " " . $_POST . " " . $_POST . "
    include \"/home/cmatcme/public_html/footer.php\"; ?> "; $a_stream = fopen(&....
  30. Can Reset The Id Auto Increment?
    phpMyadmin (10)
    hi, Can we reset the id auto increment in the mysql database using by phpMyadmin? let's say the
    shoutbox . the id #number table.. somehow i deleted some rows.. and i wanted to re-order/reset the
    id number acendingly in order rather than skip out.. thks ....

    1. Looking for error, importing, sql, query, php, works, phpmyadmin

Searching Video's for error, importing, sql, query, php, works, phpmyadmin
advertisement



Error Importing Sql Query Via Php - Works in PHPmyAdmin



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE