Jump to content


Photo

First PHP and MySQL Help Needed


  • Please log in to reply
2 replies to this topic

#1 bobber205

bobber205
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 September 2006 - 07:11 PM

I have a table called "test". I am able to connect to it.
Here's what I know about the table from what I created in phpMyAdmin.

Field    Type    Null
----------------------
Image_Name varchar(100) no
Image_URL varchar(100) no

How would I insert "alex" into image_name and "/images/alex.jpg" into image_URL?

I am confused.


#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 September 2006 - 07:22 PM

To put alex in to the table you need to insert it into the database with an sql query:

// setup our query
$sql = "INSERT INTO test (Image_Name, Image_URL) VALUES ('alex', 'images/')";
// preform the query
$result = mysql_query($sql) or die(mysql_error());



#3 bobber205

bobber205
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 September 2006 - 07:50 PM

That makes much more sense that what I was seeing. Thanks! :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users