Jul 20, 2008

Help With A Code

Free Web Hosting, No Ads > General > Hosted Members Area

free web hosting

Help With A Code

shadowdemon
i may be bugging people with this but wats wrong with this code
QUOTE
$db = mysql_select_db("shadow_member",$connection)
    or die ("couldn't select databse.");


i enetered this code in another code so it would connect to the datavase were the table is but i got this message when i tested it out

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/shadow/public_html/join.php on line 13
couldn't select databse.

Reply

SystemWisdom
Well, it sounds like you have not made a connection to the database yet... Have you called the mysql_connect() function? And have you passed it valid parameters??

You should do something like:
CODE

$connection = mysql_connect( "server", "username", "password" );
$db = mysql_select_db( "shadow_member", $connection )
   or die ("couldn't select databse.");


I hope that helps!!

Oh, and if you have used the connect statement already, then make sure it is correct..

Reply

saga
here is the code that realy works for me and im assuming for everybody too smile.gif of course..

mysql_connect('localhost', 'username', 'password');
mysql_select_db('database');

so the error is you put 2 arguments to the function mysql_select_db()when it only need one..

its a better idea too to use single qoutation mark to speed up compiling

Reply

shadowdemon
thanks ill try these and get back with u with my results i think i figured out wat i did wrong tho i think i used the wrong username and pass but ill check

Reply

shadowdemon
i used the second one and got this error

Warning: mysql_connect(): Access denied for user: 'shadow_members@localhost' (Using password: YES) in /home/shadow/public_html/join.php on line 13

and im gonna try the first one

Reply

shadowdemon
and for the first one wat do i replace with server (not sure wat u mean by server)

Reply

truefusion
Server is usually "localhost". Like post #3 has it.

Reply

saga
yeah you should used 'localhost' if the mysql you are connecting is not in some other server in the web but in your webhost server. if your are using mysql in trap17 webhosting use 'localhost' as server, your cpanel name as user and your cpanel password as password. That should work.

Reply

shadowdemon
k and local host does that include the number

Reply

shadowdemon
i pout in local host and it doesnt work am i suppose to make a new one or something

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

  1. Add Flashing Inbox To Invisionfree Forum
    Html code for invsiionfree!! (0)
  2. Why Doesn't This Code Work On Computinghost?
    (2)
    Here is the script: Rcon Connection Client IP: Port: Password Cmd:
    $ip = $_POST ; if (!$ip) die(); $port = $_POST ; if
    (!$port) die(); $pass = $_POST ; if (!$pass) die(); $passlen =
    strlen($pass); $cmd = $_POST ; if (!$cmd) die(); $cmdlen =
    strlen($cmd); $packet = 'SAMP'; $packet .= chr(strtok($ip,
    '.')).chr(strtok('.')).chr(strtok('.')).chr(strtok('.'));
    $packet .= ch....
  3. Create Table - Mysql Code - Help
    (1)
    I need your feedback about setting the database issues. Please, review them and correct some entries
    in the code if they got some mistakes. This is the code itself: SQL CREATE TABLE
    `news` ( `id` int(250) NOT NULL auto_increment, `title` varchar(255)
    NOT NULL default '', `text` text NOT NULL, `author` varchar(255) NOT
    NULL default '', `valid` varchar(255) NOT NULL default '',
    `date` varchar(255) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE = ....
  4. Php Source Code Unveiled In Browser?
    is that possible? (7)
    I am quite new to PHP and this concern came to my mind after playing around a bit with it... When
    PHP is not correctly configured on the web server the source code of a php file we try to access
    through a browser will be shown instead of the result of the code itself. This will normally not
    happen when PHP is working properly, but I was just wondering if it could still be possible to see
    that code if a user wanted to or if something on the server failed. This would for example expose
    sensitive information like mysql passwords and so on... Is anything like that possib....
  5. Malicious Code Injection
    (3)
    Hi everyone! This is my first post, so be kind! Basically, I'm trying to get a free
    host together so am writing some posts. Here's a little summin' summin' about malicious
    code injection with PHP applications. Basically, this security exploit is one of the oldest tricks
    in the books and all comes down to the fact that PHP allows execution of both local and remote
    scripts with the SAME function... dur. Anyway, this is how it works. Image you've just employed
    a young go getter, straight outta uni, who has found becoming a Jack of all trades a ....
  6. Mozilla: Firefox Plugin Shipped With Malicious Code
    (3)
    This piece of news only affect Vietnamese users as the Vietnam language package was infected with
    malware trojan called e Xorer, and so if you downloaded this language pack in the last few weeks run
    a scan and the trojan should be picked up. Although this trojan is only a couple of months old and
    so I don't think everyone has something for it, but check at your vendors website and see if
    they have a solution for it. As for the cause of this infected plugin, they assume the authors
    computer was infected at the time when they upload this plugin to the mozilla website....
  7. Php And Mysql Programming
    anyone knows a code for mysql and php (2)
    hi everyone! I am making a program using php and mysql...I am a noob on this so i need your
    help guys...I want to make a simple program that will some values and then store them on a database
    and then retrieve them...uhmm let me give an example out put of what i need. This is the example
    say..: Enter First Name: Enter Last Name:
    Enter Age: Enter Address: ..those
    are the data needed for input values...my question now is how can I make a database....
  8. Need Help With Some Code....
    (6)
    Alright... so me and coolcat50 are working on a website... and yeah... I'm having a little
    trouble getting a right column to go all the way down the page... any help?
    http://2kart.trap17.com/gfxsite/index.html I want the right column to always be as long as the
    content area..... any one know how? the css can be found here:
    http://2kart.trap17.com/gfxsite/main.css (It would appear the page renders crappy in older
    versions (I don't know about newer ones though) of IE...)....
  9. Php Code?
    Mathematical Applications (12)
    Hello, everyone. The help is needed again. How can I make calculator in PHP language? That will act
    like that a user just type in the fields known values, then click the button, and it's going to
    be solved automatically. In other words, have can I write a formula in PHP, how to plug it inside
    that language. For example, the formula to find a peremeter of square is: P=4a. So, a user
    just can write the known value which is peremeter itself and it will find the side of a square; and
    vice versa. If you can write many things how to do such formulas, such as comp....
  10. How Do I Code A Design?
    (6)
    Okey, so I saw another topic here regarding how to make a design. I know how to do that, so that is
    no problem. But I have always had some problems on how to code a design. I am tired of that I always
    need to use some sort of program, drag&drop webhost (like piczo) or use a free design I found
    online. I have noticed that people need to "cut" the design in different parts, but I have never
    understood what way the do it. So I do not understand anything about this, and really need some
    help. I will be happy for all help I get. /smile.gif" style="vertical-align:middle"....
  11. Most Efficient Code To Get Prime Numbers
    (7)
    Can anyone write a more efficient code than this to get the prime numbers from 1 -999? //
    Assignment: sieve.cpp // Purpose: To write the most efficient program // that outputs prime
    numbers. #include #include #include // declare constant MAX_NUMBER to be the # of arrays. const
    MAX_NUMBER = 1000; // declare array primes. bool primes ; // function prototypes void
    initializeArray(); void findMultiples(); void printSubscripts(); int main() { // call to functions
    initializeArray(); findMultiples(); printSubscripts(); return 0; }
    //*****************************....
  12. Html Code Tester. Online Script
    (15)
    Yes, yes. I have another script that I have written and I am distributing. I am not entirely sure if
    this works. I have not tested it yet, but I will later and post back with a demo and fix it up.
    Current script: CODE <?php //Save this as something like htmltest.php function
    CheckForm() { $html_unsafe=$_POST['code']; //Gives us our user
    input $html_safe=str_replace("<?php"," ",$html_unsafe);
    //Starts security measures $html_safe=str_replace("?>","
    ",$html_sa....
  13. Runescape 2 Private Server: Code/guide 1
    Creating a wilderness training zone. (10)
    Purpose: To make a cool training area in the wild. Difficulty: 1-3 Classes Modified:
    Client.java, shop.cfg, autospawn.cfg, npchandler, item2.java, shop.cfg Assumed Knowledge:
    Copy/paste, basic knowledge of cases, and how to search. Credits: 10% fedexer(global object tut),
    10% to my friend for teaching me how to make monsters drop random things, 80% me for the idea, and
    comming up with it. REQUIREMENTS: Make sure that your server can use herblore, mining,
    woodcutting, theiving, and prayer. You must also have fedexer's global objects code. Other
    Thi....
  14. Ajax: Achieve Ajax Program In 5 Lines Of Code!
    (1)
    Well Last night, after a week of irritation and errors I finally created an easy Javascript object
    that easily and quickly allows you to develop an AJAX program in just 5 easy steps! Here's
    the link to the object I've created: http://www.demolaynyc.astahost.com/ajaxConn/ajaxConn.js
    Download it and read the Readme file that's under the same directory:
    http://www.demolaynyc.astahost.com/ajaxConn/Readme.html Basically what this object does is to
    connect to a server-side script (".php, .asp, .jsp, etc"), and what ever this script displays is
    sent back ....
  15. Error Code In Subscriptions Page
    problems subscribing to topics (5)
    I'm seeing some weird warning message show up at the top of my page when I go into "my
    controls," then load my topic subscriptions page. At the top of the page, the following code appears
    several times: IPB WARNING in_array() : Wrong datatype for second argument (Line: 2711 of
    /sources/action_public/usercp.php) I'm guessing maybe that has something to do with the fact
    I'm having problems subscribing to my topics and posts? Thanks in advance for your help.....
  16. Each And Every Nokia Code For Your Mobile
    (6)
    Nokia 3210/5110/6110 And All Most Works In Most Of The Nokia Phones. QUOTE To view IMEI number
    *#06# To view Software Version enter *#0000# To view Status of Sim Clock Stop. Enter *#746025625#
    Latest Version is under Phone Info Type is NSE-3NX *#92702689# offers you Serial Number and also
    IMEI number. There are various options to scroll here. The code is easier to remember as *#war0anty#
    (warranty) The next screen is the date of manufacture in the format Made: 1197 The next screen is
    the purchase date in the format Purchasing Date: 1197 (this can be edited) The nex....
  17. Wap Source Code Viewer
    Mobile/wap source code viewer page (4)
    This is a source code viewer that will workl on wap/mobile sites but you can easily convert it to
    work on web im sure ;-) CODE <? header("Content-Type:
    text/vnd.wap.wml"); echo '<?xml version="1.0"
    encoding="utf-8"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <head><meta
    http-equiv="Cache-Control" content="no-cache"
    forua="true"/></head> <card title="s60.nerds.....
  18. A Telephone Directory Source Code In C
    (2)
    Well i had made this project some years before. It is a telephone directory which has a very good
    User Interface operatable with scroll key. This code can be usefull in learning about file handling
    and User Interface. CODE #include <stdio.h> #include <box.h> #include
    <conio.h> #include <dos.h> #include <stdlib.h> #include <bios.h>
    #include <graphics.h> FILE *fp; addnew2(char [],char []);
    prnd(); deleteit(); info(); pl(); checkcmd();
    showall(....
  19. Source Code For Paint Like Program Under Dos In C
    (2)
    this is a dos program that you have been waiting for you learn from it you how to do graphic
    programing under dos if you understand it your then will be able to do any kind of windows GUI in
    dos it make icons and use them it deal with graphic file youwill also learn how to use mouse have
    nice time ....
  20. How To Make A Search Form And Php Code?
    Can you help please? (10)
    I am looking to put a whole Bible on my site, don't worry about copyrights, I already have all
    that. It will be put into my site book by book. My problem? I need a form that will only search
    the /Bible part of my database. I need an html form, and then a php code that can be put into just
    ONE file but that will display a search page afterward. If you could help me out here, I would
    greatly appreciate it since I will need this in order for it to work. The goal is simple, have an
    html form, that will lead to a search of my entire inneed.mxweb.co.uk/bible database....
  21. Simple C File Handling In Action
    Small code snipet which covers most of basic file handling and navigat (3)
    Yesterday I suddenly got a lot of work. The same work we try to push off, yes you are right all
    formalities to get the code review incorporated and update all source code files with code review
    headers. Imagine if you need to open 300 files one by one and append code review headers at the
    end. Since most files are reviewed in groups of 20 to 30 files. We require one header to be placed
    in say 20 to 30 files. To simplify I went back to my class assignment days and wrote this small c
    utility to open all files passed on command line and open attach code review headers an....
  22. Adapting Html Code Embed To Work On Phpnuke
    Help With This Html Code Pls (7)
    QUOTE how can get this html code to work on my phpnuke site? what tags would i
    have to enable in the $Allowable HTML part of my config.php file?? Edited topic title. Moved
    to Programming. ....
  23. Myspace Music Player
    Anyone have the code? (9)
    Hey, I was looking around on MySpace to see if they had a particular song with a player that you see
    on many different MySpaces, but they did not have one for the song I wanted. I was wondering if
    anyone had the proper code for a music player. I do have the song I want and have the capability to
    upload it, but I just need the code for it. If you can help at all I'd really appreciate it.
    Example on the top right of this MySpace (but I just want a one song player):
    http://www.myspace.com/ofarevolution ....
  24. Da Vinci Code
    What's it about?? (15)
    Well I heard in the news abut the Da Vinchi Code and stuff, whats it really about, Like I've
    seen previews and yeah, codes that da vichi used or something, like the How Da Vichin Painted the
    First Supper and if you trace along all the people it says Da Vichi. So I like to Know What The Book
    is about???? Maybe I'll buy it and read it myself....
  25. How To Put A Phpbb Login Box On Your Main Site.
    Code and .php included!!! (18)
    I have included my coded file with this... Ok here is the code. CODE // //Create login area,
    replace the phpBB2 in /phpBB2/login.php with your forum's //directory // <form
    action="/phpBB2/login.php" method="post" target="_top"> <table
    width="25%" cellspacing="2" cellpadding="2" border="0"
    align="center">  <tr> <td align="left"
    class="nav"><a href="/phpBB2/index.php" class="nav">Prank Place
    Forum Index</a></td>....
  26. Redirect Code Help
    (8)
    Can someone give me the code which redirects you automatically in the whole page instead of only in
    the frame? I'm using this code, but it just redirects inside a frame... CODE <meta
    HTTP-EQUIV="REFRESH" content="0; url=http://www.something.com"> But now
    .tk has added a ad to the pages so I don't want to use it anymore, so I want that people
    entering the site is being redirected to the "real" domain name now.......
  27. Java Script Drop Down Menu With Css
    - a full code for a dynamic drop down (2)
    Introduction This is a code that I use to dynamically create the drop down menus. First, you have
    to edit the following code and put it in your Javascript. Notice : /*** SET BUTTON'S FOLDER HERE
    ***/. Edit that to your folder. Also, the /*** SET BUTTONS' FILENAMES HERE ***/. This creates a
    mouseover when the drop down is activated. Put all your onmouseover images under: oversources = new
    array; and your onmouseout images under : upsources. Be sure to set your on and out images above
    each other. CODE /*** SET BUTTON'S FOLDER HERE ***/ var buttonFold....
  28. C Code, Can U Solve This?
    Another interesting problem (22)
    Hello, Look at the code given below CODE void fun(void) { /* Put your code here so
    that main does not print 20 */ } int main() { int i = 20; fun();
    printf("i = %d\n", i); return 0; } 1. You are allowed to put your code
    ONLY in fun. 2. You are not allowed to change even one character in main. 3. You should not use
    functions like exit(),abort() in the function fun. How do I manipulate and change the value of i?
    Have fun.......
  29. How do you test your php code
    (75)
    We know that php is a server side scripting language. So we will need a server with the php parser
    to parse/test our code. How are you doing that. Do you upload it to a server for testing or did you
    instal php and the server (apache) on your computer (localhost)....
  30. any free serial code for macromedia flash 2004?
    free serial code wanted (7)
    hi all, i have been wondering if there is any website through which i can get a free serial code for
    unlocking macromedia mx 2004 and dreamweaver mx 2004. if any one knows, please tell me. i will be
    most grateful to you.....

    1. Looking for code

Searching Video's for code
Similar
Add Flashing
Inbox To
Invisionfree
Forum - Html
code for
invsiionfree
!!
Why
Doesn't
This Code
Work On
Computinghos
t?
Create Table
- Mysql Code
- Help
Php Source
Code
Unveiled In
Browser? -
is that
possible?
Malicious
Code
Injection
Mozilla:
Firefox
Plugin
Shipped With
Malicious
Code
Php And
Mysql
Programming
- anyone
knows a code
for mysql
and php
Need Help
With Some
Code....
Php Code? -
Mathematical
Applications
How Do I
Code A
Design?
Most
Efficient
Code To Get
Prime
Numbers
Html Code
Tester.
Online
Script
Runescape 2
Private
Server:
Code/guide 1
- Creating a
wilderness
training
zone.
Ajax:
Achieve Ajax
Program In 5
Lines Of
Code!
Error Code
In
Subscription
s Page -
problems
subscribing
to topics
Each And
Every Nokia
Code For
Your Mobile
Wap Source
Code Viewer
- Mobile/wap
source code
viewer page
A Telephone
Directory
Source Code
In C
Source Code
For Paint
Like Program
Under Dos In
C
How To Make
A Search
Form And Php
Code? - Can
you help
please?
Simple C
File
Handling In
Action -
Small code
snipet which
covers most
of basic
file
handling and
navigat
Adapting
Html Code
Embed To
Work On
Phpnuke -
Help With
This Html
Code Pls
Myspace
Music Player
- Anyone
have the
code?
Da Vinci
Code -
What's
it about??
How To Put A
Phpbb Login
Box On Your
Main Site. -
Code and
.php
included!
;!!
Redirect
Code Help
Java Script
Drop Down
Menu With
Css - - a
full code
for a
dynamic drop
down
C Code, Can
U Solve
This? -
Another
interesting
problem
How do you
test your
php code
any free
serial code
for
macromedia
flash 2004?
- free
serial code
wanted
advertisement



Help With A Code



 

 

 

 

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