182x Posted November 17, 2006 Share Posted November 17, 2006 Hey guys, I am using the following code to try to insert a record into a table but its not working and I was just wondering why and also it has to work with an older version of PHP 4.x so i was just wondering is this possible?Thanks for any help. [code]<?php session_start(); include('db.php'); $link_id = db_connect(''); $query="INSERT INTO c (cur) VALUES('$HTTP_SESSION_VARS['curr']')"; mysql_query($query, $link_id); header("location:de.php");?>[/code] Link to comment https://forums.phpfreaks.com/topic/27537-inserting-session-variables-into-a-table/ Share on other sites More sharing options...
The Little Guy Posted November 17, 2006 Share Posted November 17, 2006 here is an example of how to insert into a mysql database[code]<?phpsession_start();$_SESSION['favcolor'] = "green"; // green$_SESSION['animal'] = "cat"; // cat$query="INSERT INTO c (`favcolor`,`animal`) VALUES('$_SESSION[favcolor]','$_SESSION[animal]')"; mysql_query($query, $link_id);header("location:de.php");?>[/code] Link to comment https://forums.phpfreaks.com/topic/27537-inserting-session-variables-into-a-table/#findComment-126004 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.