[SOLVED] PHP database code issue

This is a discussion on "[SOLVED] PHP database code issue" within the PHP Forum section. This forum, and the thread "[SOLVED] PHP database code issue are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #21 (permalink)  
Old Mar 22nd, 2008, 18:02
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

above is the entire script - db details
Reply With Quote
  #22 (permalink)  
Old Mar 22nd, 2008, 18:02
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

all that will be extra is a css link
Reply With Quote
  #23 (permalink)  
Old Mar 22nd, 2008, 18:11
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 22 Times in 22 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Re: PHP database code issue

It should so SOMETHING

a link maybe?
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
Reply With Quote
  #24 (permalink)  
Old Mar 22nd, 2008, 18:12
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 22 Times in 22 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Re: PHP database code issue

wait, i got it

PHP: Select all

<?php
$host
=""// Host name
$username=""// Mysql username
$password=""// Mysql password
$db_name=""// Database name
$tbl_name=""// Table name

// Connect to server and select databse.
mysql_connect("$host""$username""$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

m// issue the query
$sql "SELECT * FROM members WHERE
        username = '"
.$_POST["username"]."' AND
        password = PASSWORD('"
.$_POST["password"]."')";
$result mysqli_query($mysqli$sql) or die(mysqli_error($mysqli));
if(
$info mysqli_fetch_array($result)) { 
        
//display string
    
$display_block "
    <p>"
.$info['f_name']." <p>
    <p>"
.$info['l_name']." <p>";

echo 
$display_block
} else {
   echo 
'<p>Wrong username and password!</p>';

?>
Try that. If that doesn't work......
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
Reply With Quote
  #25 (permalink)  
Old Mar 22nd, 2008, 18:15
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: PHP database code issue

PHP: Select all

 $display_block "
    <p>"
.$info['f_name']." <p>
    <p>"
.$info['l_name']." <p>"
Probably wrong, but do you need to escape the " in there? Because you are using them to assign $displayblock a value?
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #26 (permalink)  
Old Mar 22nd, 2008, 18:18
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

still nothing
Reply With Quote
  #27 (permalink)  
Old Mar 22nd, 2008, 18:19
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

http://www.lightex.co.uk/fieldworks/accountdetails.php
Reply With Quote
  #28 (permalink)  
Old Mar 22nd, 2008, 18:21
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 22 Times in 22 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Re: PHP database code issue

username and password please?
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
Reply With Quote
  #29 (permalink)  
Old Mar 23rd, 2008, 00:58
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

webforumz
webforumz
Reply With Quote
  #30 (permalink)  
Old Mar 23rd, 2008, 01:36
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 22 Times in 22 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Re: PHP database code issue

not working
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
Reply With Quote
  #31 (permalink)  
Old Mar 23rd, 2008, 10:55
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

sorry wrong one

test
webforumz
Reply With Quote
  #32 (permalink)  
Old Mar 23rd, 2008, 12:09
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

Just a question, what is that
PHP: Select all

password PASSWORD('".$_POST["password"]."')"; 

May be it should be
PHP: Select all

password '".$_POST["password"]."'
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
Reply With Quote
  #33 (permalink)  
Old Mar 23rd, 2008, 12:34
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

I'll check
Reply With Quote
  #34 (permalink)  
Old Mar 23rd, 2008, 12:50
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

No change
Reply With Quote
  #35 (permalink)  
Old Mar 25th, 2008, 19:40
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

Any one got any suggestions why I keep getting a blank page?
Reply With Quote
  #36 (permalink)  
Old Mar 25th, 2008, 21:26
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 22 Times in 22 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Re: PHP database code issue

still got the ob_start() in there?
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
Reply With Quote
  #37 (permalink)  
Old Mar 25th, 2008, 22:58
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

um where
Reply With Quote
  #38 (permalink)  
Old Mar 25th, 2008, 23:00
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

As soon as I put the DB php code in and upload the screen goes blank
Reply With Quote
  #39 (permalink)  
Old Mar 25th, 2008, 23:17
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 22 Times in 22 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Re: PHP database code issue

try putting something before the PHP code. Is that shown?
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
Reply With Quote
  #40 (permalink)  
Old Mar 25th, 2008, 23:20
acrikey's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Posts: 305
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP database code issue

I already do, when the code goes in every thing goes
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Php image upload to database issue longstand PHP Forum 5 Nov 21st, 2007 09:45
PHP Code insert into database problem longstand PHP Forum 7 Oct 13th, 2007 22:03
[SOLVED] Linking php code to a form &amp; mysql database longstand PHP Forum 21 Oct 9th, 2007 16:40
XML Code for transfering data from one SQL Server Database to another database plolla Other Programming Languages 1 Aug 3rd, 2006 18:37


All times are GMT. The time now is 02:08.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved