Jump to content

Mutley

Members
  • Posts

    765
  • Joined

  • Last visited

Everything posted by Mutley

  1. Could you give a more detailed explination on how to tie this into the first piece? I presume something needs to go after each echo?
  2. [quote author=wildteen88 link=topic=101277.msg400608#msg400608 date=1153416453] remove the single quotes - ' - from your query. Also make sure you are connected to the database too. [/quote] Awesome it worked, thank-you so much! How do I make it so I can format the result fields? For example each field result is displayed in a html table? Do I use "echo" somehow?
  3. Error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource on line 5. This line: while($r= mysql_fetch_assoc($result)) { Any ideas? Great replies so far guys, thanks.  :)
  4. [quote author=ChaosXero link=topic=101277.msg400592#msg400592 date=1153415316] [code] <?PHP $query = "SELECT * FROM 'profiles' WHERE 'id'=1"; $result = mysql_query($query); while($r= mysql_fetch_array($result)) {   foreach($r as $var){       echo $var."\n"   } } ?> [/code] Still get the error on line 8. Parse error: parse error, unexpected '}', expecting ',' or ';' in . Try that now. [/quote]
  5. Nope, get parse error on line 12. Where } is. Is that all I need? Do I not need any HTML table formatting to display the result? Thanks for the fast reply though.
  6. Hi there, Having a problem. I want it so if you goto this certain page it displays a row from the table and all the fields. I have done a config.php which is this (but filled in): [code] <?php $host = "localhost"; $user = "myusername"; $pwd = "mypassword"; $db = "mypassword"; ?> [/code] Then a connection.php file: [code]<?php require_once("config.php"); $connection = mysql_connect($host, $user, $pwd) or die("&error1=".mysql_error()); mysql_select_db($db, $connection); ?>[/code] Now I want to display a query in a table from the database but no idea how. I guess it is something like this but alot more complex. The table is called "profiles" and I want it to display all the fields in a table, under the user id 1. [code] <?php> require_once("connection.php"); $query = SELECT all fields FROM profiles WHERE id=1 ?> [/code] Any help, would be much appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.